/* ============================================
   KOPILOT Authentication Styles
   ============================================ */

/* Navigation Auth Area */
.nav-auth-area {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.nav-auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary, #635BFF);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-auth-btn:hover {
    background: var(--primary-dark, #4b45cc);
    transform: translateY(-1px);
}

.nav-auth-btn i {
    font-size: 14px;
}

/* User Menu (logged in state) */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border, #E3E8EF);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary, #0A2540);
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
}

.user-menu-btn:hover {
    background: var(--background-alt, #F6F9FC);
}

.user-menu-btn #userEmail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.user-menu-btn i.fa-user-circle {
    font-size: 18px;
    color: var(--primary, #635BFF);
}

.user-menu-btn i.fa-chevron-down {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.user-menu.active .user-menu-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border, #E3E8EF);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px 16px;
    background: var(--background-alt, #F6F9FC);
    border-bottom: 1px solid var(--border, #E3E8EF);
    font-size: 13px;
    color: var(--text-secondary, #425466);
}

.user-dropdown-header span:first-child {
    font-weight: 600;
    color: var(--primary, #635BFF);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: var(--text-primary, #0A2540);
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--background-alt, #F6F9FC);
}

.user-dropdown-item i {
    font-size: 14px;
    color: var(--text-muted, #6B7C93);
}

/* ============================================
   Auth Modal
   ============================================ */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal.active .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--background-alt, #F6F9FC);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #e9ecef;
    transform: rotate(90deg);
}

.auth-modal-close i {
    font-size: 16px;
    color: var(--text-muted, #6B7C93);
}

/* Auth Modal Header */
.auth-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary, #635BFF);
    margin-bottom: 8px;
}

.auth-modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary, #0A2540);
    margin: 0;
}

/* Auth Form */
.auth-form {
    animation: fadeInUp 0.3s ease;
}

.auth-input-group {
    margin-bottom: 20px;
}

.auth-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #425466);
    margin-bottom: 8px;
}

.auth-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border, #E3E8EF);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--primary, #635BFF);
    box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.1);
}

/* Auth Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary, #635BFF);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-submit-btn:hover:not(:disabled) {
    background: var(--primary-dark, #4b45cc);
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #E3E8EF);
}

.auth-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-muted, #6B7C93);
}

/* Google Button */
.auth-google-btn {
    width: 100%;
    padding: 14px;
    background: white;
    border: 2px solid var(--border, #E3E8EF);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #0A2540);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.auth-google-btn:hover {
    background: var(--background-alt, #F6F9FC);
    border-color: #dadce0;
}

/* Auth Links */
.auth-links {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
}

.auth-links button {
    background: transparent;
    border: none;
    color: var(--primary, #635BFF);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: color 0.2s ease;
}

.auth-links button:hover {
    color: var(--primary-dark, #4b45cc);
    text-decoration: underline;
}

.auth-link-divider {
    color: var(--border, #E3E8EF);
    margin: 0 12px;
}

/* Auth Description */
.auth-description {
    font-size: 14px;
    color: var(--text-secondary, #425466);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

/* Auth Error/Success Messages */
.auth-error,
.auth-success {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    animation: fadeInUp 0.2s ease;
}

.auth-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.auth-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-auth-area {
        margin-left: 0;
        margin-right: 10px;
    }

    .nav-auth-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .nav-auth-btn span {
        display: none;
    }

    .user-menu-btn {
        padding: 6px 10px;
    }

    .user-menu-btn #userEmail {
        display: none;
    }

    .user-dropdown {
        right: -10px;
    }

    .auth-modal-content {
        margin: 20px;
        padding: 30px 24px;
        max-width: none;
    }

    .auth-modal-header {
        margin-bottom: 24px;
    }

    .auth-logo {
        font-size: 24px;
    }

    .auth-modal-header h2 {
        font-size: 20px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
