/**
 * DubaiSchools.ai - Auth & Pro Features Styles
 */

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl, 1rem);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--gray-100, #f3f4f6);
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-700, #374151);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   AUTH MODAL
   ============================================ */
.auth-modal {
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header img {
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin-bottom: 0.25rem;
}

.auth-message {
    color: var(--gray-500, #6b7280);
    font-size: 0.875rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--gray-100, #f3f4f6);
    padding: 0.25rem;
    border-radius: var(--radius-md, 0.5rem);
}

.auth-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    border-radius: var(--radius-sm, 0.375rem);
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: var(--gray-900, #111827);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700, #374151);
    margin-bottom: 0.375rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary, #14b8a6);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary, #14b8a6);
    color: white;
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark, #0d9488);
}

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

.btn-block {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray-400, #9ca3af);
    font-size: 0.875rem;
}

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

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700, #374151);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--gray-50, #f9fafb);
    border-color: var(--gray-300, #d1d5db);
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
}

.auth-footer a {
    color: var(--primary, #14b8a6);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   UPGRADE MODAL
   ============================================ */
.upgrade-modal {
    padding: 2rem;
    text-align: center;
}

.upgrade-header {
    margin-bottom: 1.5rem;
}

.upgrade-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.upgrade-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin-bottom: 0.5rem;
}

.upgrade-header p {
    color: var(--gray-500, #6b7280);
}

.upgrade-price {
    background: linear-gradient(135deg, var(--primary, #14b8a6) 0%, var(--primary-dark, #0d9488) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg, 0.75rem);
    margin-bottom: 1.5rem;
}

.price-amount {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.price-term {
    font-size: 0.875rem;
    opacity: 0.9;
}

.upgrade-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.upgrade-features li {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    font-size: 0.875rem;
    color: var(--gray-700, #374151);
}

.upgrade-features li:last-child {
    border-bottom: none;
}

.btn-upgrade {
    font-size: 1.125rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-upgrade:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.upgrade-footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900, #111827);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg, 0.75rem);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: var(--primary, #14b8a6); }

.toast button {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    margin-left: 0.5rem;
}

.toast button:hover {
    opacity: 1;
}

/* ============================================
   HEADER AUTH ELEMENTS
   ============================================ */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-signin {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--gray-600, #4b5563);
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signin:hover {
    color: var(--gray-900, #111827);
    background: var(--gray-100, #f3f4f6);
}

.btn-signup {
    padding: 0.5rem 1rem;
    background: var(--primary, #14b8a6);
    color: white;
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signup:hover {
    background: var(--primary-dark, #0d9488);
}

.user-menu {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    background: var(--gray-100, #f3f4f6);
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    position: relative;
}

.user-menu:hover {
    background: var(--gray-200, #e5e7eb);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary, #14b8a6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700, #374151);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pro-badge {
    display: none;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    text-transform: uppercase;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700, #374151);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: var(--gray-50, #f9fafb);
}

.user-dropdown-item:first-child {
    border-radius: 0.75rem 0.75rem 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 0.75rem 0.75rem;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-100, #f3f4f6);
    margin: 0.25rem 0;
}

/* ============================================
   PRO FEATURE LOCKS
   ============================================ */
.pro-locked {
    position: relative;
    pointer-events: none;
}

.pro-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    border-radius: inherit;
}

.pro-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    padding: 1.5rem;
}

.pro-lock-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pro-lock-text {
    font-weight: 600;
    color: var(--gray-900, #111827);
    margin-bottom: 0.5rem;
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    text-transform: uppercase;
}

.pro-badge-inline {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Pro feature cards with lock */
.feature-card.pro-required {
    position: relative;
    overflow: hidden;
}

.feature-card.pro-required:not(.unlocked)::before {
    content: 'PRO';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    z-index: 5;
}

/* ============================================
   UPGRADE PROMPTS (INLINE)
   ============================================ */
.upgrade-prompt {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.upgrade-prompt h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900, #111827);
    margin-bottom: 0.5rem;
}

.upgrade-prompt p {
    color: var(--gray-600, #4b5563);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.upgrade-prompt .btn-upgrade-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-prompt .btn-upgrade-small:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .auth-modal,
    .upgrade-modal {
        padding: 1.5rem;
    }
    
    .upgrade-features li {
        font-size: 0.8125rem;
    }
    
    .user-name {
        display: none;
    }
    
    .auth-buttons .btn-signin span {
        display: none;
    }
}
