body {
    background-color: #f8f9fb;
    font-family: 'IranSans', 'Gilroy-Regular', sans-serif;
    margin: 0;
}

p {
    margin: 0;
    padding: 0;
}

/* Font */
@font-face {
    font-family: 'Gilroy';
    src: url('utils/font/Gilroy/Gilroy-Black.ttf') format('truetype');
}

@font-face {
    font-family: 'Gilroy-Regular';
    src: url('utils/font/Gilroy/Gilroy-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Gilroy-Medium';
    src: url('utils/font/Gilroy/Gilroy-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Gilroy-SemiBold';
    src: url('utils/font/Gilroy/Gilroy-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Gilroy-Bold';
    src: url('utils/font/Gilroy/Gilroy-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'IranSans';
    src: url('utils/font/IranSans/IranSans.ttf') format('truetype');
    font-display: swap;
}



/* Modal Styles */



.login-form, .signup-form {
    display: none;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal h2 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.2rem;
    text-align: center;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}


.logged-in {
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: default;
}

#user-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 8px;
}

.primary-button, .secondary-button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.primary-button {
    background: #0071C5;
    color: white;
}

.secondary-button {
    background: #f5f5f5;
    color: #333;
}

.primary-button:hover {
    background: #005999;
}

.secondary-button:hover {
    background: #e5e5e5;
}

/* Input Styles */
.modal input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.modal input:focus {
    border-color: #0071C5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 113, 197, 0.2);
}







/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0071C5;
    padding: 0 4rem;
    height: 5rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
    color: white;
    margin-left: 1em;
}

.logo-title {
    font-family: 'Gilroy-Medium', sans-serif;
    font-size: 1.3rem;
    margin: 0;
}

.logo-subtitle {
    font-size: 1.2rem;
}

/* Login Button */
.login-button {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
}

.login-button:hover {
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .25);
}

.login-button:active {
    background-color: #eeeeee;
}

.login-button:focus {
    outline: none;
    box-shadow: 
        0 -1px 0 rgba(0, 0, 0, .04),
        0 2px 4px rgba(0, 0, 0, .25),
        0 0 0 3px #c8dafc;
}

/* Video Panel */
#video-panel {
    height: calc(100vh - 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container {
    height: calc(100% - 4rem);
    width: calc(100% - 4rem);
    overflow: hidden;
    border: 2px dashed #0071C5;
    background-color: #0070c50d;
    display: flex;
    align-items: center;
    justify-content: end;
    position: relative;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-container video {
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg); /* چرخش -90 درجه برای موبایل افقی روی ربات */
}

.video-controls {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: start;
    gap: 1em;
    margin: 1em 0;
    position: absolute;
    left: 50%;
    bottom: 5%;
    transform: translateX(-50%);
    background: white;
    border-radius: 4px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
    padding: 5px;
}

.button {
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
}

.button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.button:active {
    background: rgba(0, 0, 0, 0.2);
}

/* Command Sidebar */
.command-sidebar {
    list-style-type: none;
    background: white;
    border-radius: 4px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
    padding: 15px;
    margin: 0;
    width: fit-content;
    max-height: 100%;
    min-height: 100%;
    min-width: 200px;
    overflow-y: auto;
}

#command-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 12px 0;
}

.key-display {
    min-height: 1.5rem;
    min-width: 1.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: start;
    justify-content: center;
    text-align: start;
    border-radius: 0.2rem;
    padding: 0.5rem;
    padding-left: 0.25rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.825) 0%, rgba(0, 0, 0, 0.65) 100%);
    transition: all .1s ease;
    color: white;
    box-shadow: 2px 3px 0 4px rgba(0, 0, 0, 0.8);
    user-select: none;
}

.key-pressed p {
    font-weight: bold;
}

.key-pressed .key-display {
    transform: translate(3px, 3px);
    box-shadow: 0px 0px 0 3px rgba(0, 0, 0, 0.795);
}

.space-symbol {
    min-width: 25px;
    height: 1px;
    background: white;
    border-radius: 1rem;
    margin: 0 5rem;
    margin-top: 0.2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 2rem 1.5rem;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: min(420px, 100%);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
    direction: rtl;
    text-align: right;
    font-family: 'IranSans', 'Gilroy-Regular', sans-serif;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    margin-left: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-buttons button:hover {
    background-color: #0071C5;
    color: white;
}

.auth-header {
    text-align: right;
    margin-bottom: 1.75rem;
    direction: rtl;
}

.auth-header h2 {
    font-family: 'Gilroy-SemiBold', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    color: #0f172a;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 0.75rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    direction: rtl;
    text-align: right;
    font-family: 'IranSans', sans-serif;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #2f3640;
    font-size: 0.95rem;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cbd5f5;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #f8fbff;
}

.auth-field input:focus {
    outline: none;
    border-color: #2f80ed;
    box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.15);
    background-color: #ffffff;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    justify-content: flex-start;
    direction: rtl;
}

.auth-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.auth-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.3);
}

.auth-secondary {
    background-color: #e2e8f0;
    color: #1e293b;
}

.auth-secondary:hover {
    background-color: #cbd5f5;
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.9rem;
    color: #475569;
    direction: rtl;
}

.auth-link {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.tutorial {
    padding: 2.25rem 2rem 2rem;
}

.tutorial-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tutorial-step h3 {
    font-family: 'Gilroy-SemiBold', sans-serif;
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    color: #1e293b;
}

.tutorial-step ul {
    margin: 0;
    padding-inline-start: 0;
    padding-inline-end: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: right;
}

.tutorial-step code {
    background-color: rgba(148, 163, 184, 0.15);
    color: #1d4ed8;
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
}

.tutorial-footer {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tutorial-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #475569;
    user-select: none;
}

.tutorial-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tutorial-actions {
    display: flex;
    justify-content: flex-end;
}

/* Subscription Button */
.subscribe-button {
    cursor: pointer;
    width: 90%;
    height: 30px;
    border: none;
    color: #FFFFFF;
    border-radius: 15px;
    background-color: #0071C5;
}

/* Error Message */
#error-message {
    color: white;
}

/* Utility */
video::-webkit-media-controls-timeline {
    align-self: center;
    width: calc(100% - 64px);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button:disabled {
    opacity: 0.7;
    cursor: wait;
}