/**
 * auth-styles-base.css - מבנה בסיסי ומשתנים
 * פוצל מ: auth-styles.css
 * תאריך: 2026-01-20
 *
 * תוכן:
 * - CSS Variables
 * - Auth Panel (כפתורים בפינה)
 * - Modal Overlay & Glass Card
 * - Modal Header/Body/Footer
 * - Form Styles (תמיכה לאחור)
 * - Responsive Design
 * - Scrollbar Styling
 */

/* ==========================================
   Auth Premium Styles - עיצוב פרימיום
   Glassmorphism + Modern Design
   ========================================== */

/* CSS Variables */
:root {
    --auth-primary: #667eea;
    --auth-primary-dark: #5a67d8;
    --auth-secondary: #764ba2;
    --auth-success: #10b981;
    --auth-danger: #ef4444;
    --auth-warning: #f59e0b;
    --auth-glass-bg: rgba(255, 255, 255, 0.95);
    --auth-glass-border: rgba(255, 255, 255, 0.3);
    --auth-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --auth-shadow-lg: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
    --auth-radius: 20px;
    --auth-radius-sm: 12px;
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   Auth Panel - כפתורים בפינה
   ========================================== */
.auth-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: visible !important;
}

/* כפתור התחברות עגול */
.auth-toggle-btn {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: var(--auth-transition);
    flex-shrink: 0;
}

.auth-toggle-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* כפתור אסימונים */
.tokens-icon-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.tokens-icon-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

/* כפתורי אייקון */
.auth-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--auth-transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.auth-icon-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.auth-save-btn {
    background: rgba(16, 185, 129, 0.8) !important;
}

.auth-save-btn:hover {
    background: rgba(16, 185, 129, 1) !important;
}

.auth-logout-btn {
    background: rgba(239, 68, 68, 0.8) !important;
}

.auth-logout-btn:hover {
    background: rgba(239, 68, 68, 1) !important;
}

/* כפתור עזרה */
.auth-panel .help-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--auth-transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-panel .help-link-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* כפתור איך מתחילים */
.auth-panel .tour-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--auth-transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border: none;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-panel .tour-start-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.auth-panel .tour-start-btn .btn-icon {
    font-size: 18px;
}

/* שם משתמש מחובר */
.auth-logged-in {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.auth-user-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

/* הודעת אימות מייל */
.auth-verification-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.25));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #92400e;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.auth-resend-btn {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--auth-transition);
    white-space: nowrap;
    font-weight: 600;
}

.auth-resend-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   Modal Overlay - Glassmorphism
   ========================================== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85), rgba(118, 75, 162, 0.85));
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none; /* 🔧 FIX: מונע חסימת לחיצות כשהמודל לא פעיל */
    transition: opacity 0.4s ease;
    padding: 20px;
}

.auth-modal-overlay.auth-modal-visible {
    opacity: 1;
    pointer-events: auto; /* ✅ מאפשר לחיצות רק כשהמודל פעיל */
}

/* תמיכה לאחור - auth-modal הישן */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   Glass Card - כרטיס זכוכית
   ========================================== */
.auth-modal-glass {
    background: var(--auth-glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-lg);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--auth-glass-border);
}

.auth-modal-visible .auth-modal-glass {
    transform: scale(1) translateY(0);
}

/* תמיכה לאחור */
.auth-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   Modal Header - Professional
   ========================================== */
.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 28px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    letter-spacing: -0.02em;
}

/* כפתור סגירה - Professional */
.auth-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
}

.auth-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

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

/* ==========================================
   Modal Body
   ========================================== */
.auth-modal-body {
    padding: 24px;
}

.auth-subtitle {
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}
/* ==========================================
   Modal Footer
   ========================================== */
.auth-modal-footer {
    padding: 18px 24px;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-top: 1px solid #e5e7eb;
    text-align: center;
    border-radius: 0 0 var(--auth-radius) var(--auth-radius);
}

.auth-modal-footer p {
    color: #6b7280;
    font-size: 0.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ==========================================
   Form Styles - תמיכה לאחור
   ========================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--auth-radius-sm);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: var(--auth-transition);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.auth-form input[type="email"] {
    direction: ltr;
    text-align: left;
}

.auth-form input[type="email"]::placeholder {
    direction: rtl;
    text-align: right;
}

.auth-logged-out {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================
   Responsive - התאמה למסכים קטנים
   ========================================== */
@media (max-width: 768px) {
    .auth-panel .tour-start-btn span:not(.btn-icon) {
        display: none;
    }

    .auth-panel .help-link-btn {
        padding: 10px;
        border-radius: 50%;
    }

    .auth-panel .help-link-btn span:first-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-modal-glass,
    .auth-modal-content {
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }

    .auth-modal-header {
        padding: 20px 20px 0;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .auth-modal-title {
        font-size: 1.3rem;
    }

    .auth-input {
        padding: 16px 16px 16px 45px;
    }

    .auth-input[type="password"],
    input#authPassword.auth-input,
    input#authConfirmPassword.auth-input {
        padding-right: 45px;
    }

    .auth-verification-warning {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .auth-verification-warning span {
        width: 100%;
    }

    .auth-resend-btn {
        width: 100%;
    }
}

/* ==========================================
   Reduced Motion - תמיכה בנגישות
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .auth-modal-glass,
    .auth-modal-content,
    .auth-input,
    .auth-btn-gradient,
    .auth-btn,
    .auth-close-btn,
    .auth-logo-icon,
    .auth-toggle-btn,
    .auth-icon-btn {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================
   Scrollbar Styling
   ========================================== */
.auth-modal-glass::-webkit-scrollbar,
.auth-modal-content::-webkit-scrollbar {
    width: 6px;
}

.auth-modal-glass::-webkit-scrollbar-track,
.auth-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.auth-modal-glass::-webkit-scrollbar-thumb,
.auth-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    border-radius: 3px;
}

.auth-modal-glass::-webkit-scrollbar-thumb:hover,
.auth-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--auth-primary-dark);
}
