/* =========================================
   1. הגדרות בסיס ומשתנים (Theme)
   ========================================= */
:root {
    /* פלטת צבעים: כחול-צי עמוק וזהב יוקרתי */
    --color-bg-dark: #020617;
    /* Slate 950 */
    --color-bg-light: #1e293b;
    /* Slate 800 */
    --color-accent: #C0A062;
    /* Metallic Gold */
    --color-accent-hover: #D4B475;
    /* Lighter Gold */
    --color-text-main: #F8FAFC;
    /* Off-white */
    --color-text-muted: #94A3B8;
    /* Slate 400 */

    /* אפקט זכוכית */
    --glass-bg: rgba(30, 41, 59, 0.9);
    /* כהה יותר לקריאות טובה */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(20px);

    /* מידות */
    --card-radius: 24px;
    --btn-radius: 14px;
    --font-he: 'Assistant', sans-serif;
    --font-en: 'Inter', sans-serif;
}

/* =========================================
   2. איפוס ועיצוב גוף הדף
   ========================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-en);
    background-color: var(--color-bg-dark);
    /* רקע גרדיאנט עדין ויציב */
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #020617 80%);
    color: var(--color-text-main);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    /* רווח למובייל */
    overflow-x: hidden;
    transition: filter 0.3s ease;
}

body[dir="rtl"] {
    font-family: var(--font-he);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
}

/* כניסה חלקה (Fade In) */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   3. הכרטיס הראשי
   ========================================= */
.card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 2.5rem 1.5rem;
    box-shadow: var(--glass-shadow);
    text-align: center;
    margin-bottom: 80px;
    /* מקום לכפתור הנגישות שלא יסתיר */
}

/* --- תמונת פרופיל ושם --- */
.state-emblem {
    width: 35px;
    height: auto;
    margin-bottom: 15px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.profile-img-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    /* מסגרת זהב יציבה */
    border: 3px solid var(--color-accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    padding: 3px;
    background: var(--color-bg-light);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* השם - עיצוב יציב וברור (ללא היעלמות) */
#name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: var(--color-accent);
    /* זהב מלא */
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    /* צל חזק לקריאות */
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* --- כפתורים ופעולות --- */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    gap: 8px;
    direction: ltr;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--color-text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.3s;
}

.lang-btn.active {
    background: var(--color-accent);
    color: #000;
    border-color: var(--color-accent);
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--color-text-main);
    transition: 0.3s;
}

.action-btn:hover {
    background: var(--color-accent);
    color: #000;
    transform: translateY(-3px);
}

.action-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--color-accent);
    color: #000;
    border-radius: var(--btn-radius);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(192, 160, 98, 0.2);
    margin-bottom: 2rem;
}

.primary-btn:active {
    transform: scale(0.98);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.social-icon {
    font-size: 1.4rem;
    color: var(--color-text-muted);
    transition: 0.3s;
    background: none;
}

.social-icon:hover {
    color: var(--color-text-main);
    transform: scale(1.1);
}

/* --- אודות --- */
.about-section {
    text-align: start;
}

.accordion-header {
    width: 100%;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-main);
    font-weight: 600;
    padding: 10px 5px;
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.accordion-content>div {
    overflow: hidden;
}

.accordion-content.open {
    grid-template-rows: 1fr;
}

.bio-text {
    padding-top: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(248, 250, 252, 0.9);
}

.bio-text h3 {
    color: var(--color-accent);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.bio-highlight {
    background: rgba(192, 160, 98, 0.1);
    border-inline-start: 3px solid var(--color-accent);
    padding: 10px;
    margin: 12px 0;
    border-radius: 4px;
}

.achievements-list {
    list-style: none;
    margin-top: 12px;
}

.achievements-list li {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.achievements-list i {
    color: var(--color-accent);
    margin-top: 4px;
}

footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

/* =========================================
   4. נגישות (צד שמאל - תחתון)
   ========================================= */
.acc-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    /* בצד שמאל */
    right: auto;

    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: 0.3s;
}

.acc-fab:hover {
    transform: scale(1.1);
    background: var(--color-accent);
    color: #000;
}

.acc-menu {
    position: fixed;
    bottom: 75px;
    left: 20px;
    /* מעל הכפתור בצד שמאל */
    right: auto;

    width: 240px;
    background: #1e293b;
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    padding: 15px;
    z-index: 1999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
}

.acc-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* התאמות שפה לנגישות */
body[dir="ltr"] .acc-fab {
    left: auto;
    right: 20px;
}

body[dir="ltr"] .acc-menu {
    left: auto;
    right: 20px;
}

.acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.acc-header h3 {
    color: var(--color-accent);
    font-size: 1rem;
    margin: 0;
}

.close-btn-acc {
    background: none;
    color: #fff;
    font-size: 1.2rem;
}

.acc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acc-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    width: 100%;
}

.acc-option-btn.active {
    background: var(--color-accent);
    color: #000;
}

/* מצבי נגישות */
body.acc-increased-font {
    font-size: 18px;
}

body.acc-grayscale {
    filter: grayscale(100%);
}

body.acc-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.acc-high-contrast .card,
body.acc-high-contrast .acc-menu {
    background: #000 !important;
    border: 2px solid yellow !important;
}

body.acc-high-contrast #name,
body.acc-high-contrast .color-accent {
    color: yellow !important;
    text-shadow: none;
}

body.acc-high-contrast .primary-btn,
body.acc-high-contrast .acc-fab,
body.acc-high-contrast .acc-option-btn.active {
    background: yellow !important;
    color: #000 !important;
}

/* =========================================
   5. מודלים ופופ-אפים
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--color-accent);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    transform: scale(0.9);
    transition: 0.3s;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    color: #aaa;
    font-size: 1.5rem;
}

.qr-wrapper {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    margin: 15px auto;
    width: 200px;
    height: 200px;
}

/* גודל קבוע ל-QR */
.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-instruction {
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
}

/* WhatsApp Toast */
.wa-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    background: #1e293b;
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    padding: 12px;
    z-index: 2500;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.wa-toast.show {
    opacity: 1;
    visibility: visible;
}

.wa-toast-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.wa-text i {
    color: #25D366;
    font-size: 1.2rem;
}

.wa-actions {
    display: flex;
    gap: 8px;
}

.wa-btn-yes {
    background: #25D366;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.wa-btn-no {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

#wa-input-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#wa-input-container.hidden {
    display: none;
}

#visitor-name {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #000;
    color: #fff;
}

.wa-send-arrow {
    background: var(--color-accent);
    color: #000;
    width: 40px;
    border-radius: 6px;
}

.toast {
    visibility: hidden;
    background: var(--color-accent);
    color: #000;
    padding: 10px 20px;
    border-radius: 30px;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    font-weight: bold;
    opacity: 0;
    transition: 0.3s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

@media (max-width: 380px) {
    .card {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .profile-info h1 {
        font-size: 1.8rem;
    }
}