/**
 * Authentication Modal Styles
 * Login and Registration Modal Styling
 */

/* ==================== Account Dropdown Wrapper ==================== */
.account-dropdown-wrapper {
    position: relative;
}

.account-trigger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    font: inherit;
    padding: 0;
}

.account-trigger svg {
    width: 24px;
    height: 24px;
}

/* ==================== Account Dropdown (xl and xxl only) ==================== */
.account-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

/* Show dropdown only on xl and xxl screens (1200px+) */
@media (min-width: 1200px) {
    .account-dropdown {
        display: block;
    }

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

/* Account Dropdown Header (Logged In User) */
.account-dropdown-header {
    padding: 1.25rem;
}

.account-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.account-user-details {
    flex: 1;
    min-width: 0;
}

.account-user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1a202c;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-user-email {
    font-size: 0.8125rem;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Divider */
.account-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
}

/* Dropdown Body */
.account-dropdown-body {
    padding: 0.5rem;
}

.account-dropdown-body.guest-menu {
    padding: 0.75rem;
}

/* Dropdown Items */
.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.account-dropdown-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.account-dropdown-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.account-dropdown-item span {
    flex: 1;
}

/* Logout Button */
.account-logout-form {
    margin: 0;
}

.logout-btn {
    color: #e53e3e;
}

.logout-btn:hover {
    background: #fff5f5;
    color: #c53030;
}

/* Dropdown Footer */
.account-dropdown-footer {
    padding: 0.5rem;
}

/* ==================== Auth Modal Styles ==================== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

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

/* Modal Overlay */
.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1;
}

/* Modal Close Button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f7fafc;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

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

.auth-modal-close svg {
    width: 20px;
    height: 20px;
    color: #4a5568;
}

/* Modal Header */
.auth-modal-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.auth-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.auth-modal-header p {
    font-size: 0.9375rem;
    color: #718096;
    margin: 0;
}

/* Modal Body */
.auth-modal-body {
    padding: 0 2rem 2rem;
}

/* Auth Form */
.auth-form {
    margin-bottom: 1.5rem;
}

/* Form Row (for side-by-side inputs) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Form Group */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    outline: none;
    background: white;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #a0aec0;
}

/* Form Group Inline (Remember me & Forgot password) */
.form-group-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 0;
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: white;
    color: #718096;
    font-size: 0.875rem;
    z-index: 1;
}

/* Google Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: white;
    color: #4a5568;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-google:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* Link Primary */
.link-primary {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.link-primary:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer p {
    color: #718096;
    font-size: 0.9375rem;
    margin: 0;
}

/* ==================== Responsive Styles ==================== */
@media (max-width: 640px) {
    .auth-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .auth-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .auth-modal-header h2 {
        font-size: 1.5rem;
    }

    .auth-modal-body {
        padding: 0 1.5rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .account-dropdown {
        min-width: 240px;
        right: -1rem;
    }
}

/* ==================== XL and XXL Screen Adjustments ==================== */
@media (min-width: 1200px) {
    .account-dropdown {
        min-width: 320px;
    }
}

@media (min-width: 1400px) {
    .account-dropdown {
        min-width: 340px;
    }

    .account-dropdown-item {
        font-size: 1rem;
        padding: 0.875rem 1.125rem;
    }

    .account-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }

    .account-user-name {
        font-size: 1rem;
    }

    .account-user-email {
        font-size: 0.875rem;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .auth-modal,
    .account-dropdown {
        display: none !important;
    }
}
