/* 🎨 הגדרות צבעים כלליות */
:root {
    --bg-color: #f0f2f5;
    --text-color: #1a1a1a;
    --container-bg: #ffffff;
    --accent: #111111;
    --button-bg: #a020f0;
    --button-hover: #8b00d1;
    --border-radius: 14px;
    --star-color: gold;
}

/* 🧼 הסתרת פס גלילה גלובלית (גלילה עדיין עובדת) */
html,
body {
    /* Firefox */
    scrollbar-width: none;
    /* IE/Edge Legacy */
    -ms-overflow-style: none;
    /* להפחית קופצות ו־pull-to-refresh */
    overscroll-behavior: none;
}

/* Chrome / Edge / Safari / Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}


/* 🌙 מצב כהה */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f0f0f0;
    --container-bg: #1e1e1e;
    --accent: #ffffff;
    --button-bg: #a020f0;
    --button-hover: #8b00d1;
}

/* איפוס דפדפן */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

/* גוף הדף */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s, direction 0.4s ease;
    padding-top: 25px;
}

/* 🇮🇱/🇺🇸 כיווניות */
body[data-dir="rtl"] {
    direction: rtl;
}

body[data-dir="ltr"] {
    direction: ltr;
}

body[data-dir="rtl"] .top-bar {
    direction: rtl;
}

body[data-dir="ltr"] .top-bar {
    direction: ltr;
}

/* 🔝 פס עליון */
.top-bar {
    height: 25px;
    background-color: #121212;
    color: white;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    border-bottom: 1px solid var(--text-color);
}

/* האדר - תמיד LTR */
header {
    direction: ltr !important;
    text-align: left !important;
    position: fixed;
    top: 25px;
    width: 100%;
    background: var(--container-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--text-color);
}

/* כפתורי שליטה ב-header */
header .controls {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
}

header .controls * {
    direction: ltr !important;
}

/* כפתורי שליטה */
.controls {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

/* 🔘 כפתור שפה */
.lang-toggle {
    font-size: 1.2em;
    cursor: pointer;
    border-radius: var(--border-radius);
    background: var(--container-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: relative;
    width: 36px;
    height: 36px;
}

/* תמונת הדגל */
.flag-icon {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    box-shadow: 0 0 3px var(--accent), 0 0 3px rgba(160, 32, 240, 0.5);
    position: absolute;
    top: 2px;
    left: 2px;
    backface-visibility: hidden;
    transform-origin: 50% 50%;
}

/* ===== אפקט הסיבוב הדו-שלבי ===== */
.flag-next.spin-right-in {
    animation: flag-spin-right-in 260ms ease forwards;
}

.flag-current.spin-right-out {
    animation: flag-spin-right-out 260ms ease forwards;
}

.flag-next.spin-left-in {
    animation: flag-spin-left-in 260ms ease forwards;
}

.flag-current.spin-left-out {
    animation: flag-spin-left-out 260ms ease forwards;
}

@keyframes flag-spin-right-out {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(180deg);
    }
}

@keyframes flag-spin-right-in {
    0% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes flag-spin-left-out {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(-180deg);
    }
}

@keyframes flag-spin-left-in {
    0% {
        transform: rotate(-180deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* הובר עדין */
.lang-toggle:hover .flag-icon {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

/* 🎛 Toggle Theme — עם תיקוני מובייל ו-webkit */
.theme-toggle,
.theme-toggle * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.theme-toggle {
    width: 53px;
    height: 28px;
    border: 2px solid var(--text-color);
    border-radius: 25px;
    background-color: var(--container-bg);
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: background-color 0.3s ease;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    --webkit-appearance: none;
    /* נשמר כמו במקור שלך */
    outline: none;
    --webkit-mask-image: -webkit-radial-gradient(white, black);
    /* נשמר כמו במקור שלך */
    isolation: isolate;
    /* יציבות שכבות */
}

.theme-toggle.dark {
    background-color: var(--container-bg);
}

/* 🛠 iOS Chrome artifact fix: משתמשים ב-transform במקום left + קליפ עגול */
.toggle-thumb {
    width: 18px;
    height: 18px;
    background-color: var(--text-color);
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 3px;
    transform: translateX(0) translateZ(0);
    transition: transform 0.3s ease;
    clip-path: circle(50% at 50% 50%);
    will-change: transform;
    pointer-events: none;
    background-clip: padding-box;
    --webkit-appearance: none;
    /* נשמר כמו במקור שלך */
}

.theme-toggle.dark .toggle-thumb {
    transform: translateX(26px) translateZ(0);
    /* 28-2 = 26 */
    /* background-color: #fff;  ← אם תבחר לצבוע ב-dark, בלי transition על צבע */
}

/* 🛡️ אנטי-שמירה: הקשחת תמונות */
img.no-save,
.flag-icon,
/* הדגלים */
.profile-img,
/* תמונת הפרופיל */
#reviews .review img

/* תמונות בביקורות */
    {
    -webkit-user-drag: none;
    --user-drag: none;
    /* חלקי תמיכה */
    -webkit-touch-callout: none;
    /* iOS: בלי תפריט לחיצה ארוכה */
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
    /* ההורה יקבל את ה-click */
}

/* רקע תמונתי שנרצה להקשיח */
.no-save-bg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
    /* אם אין צורך באינטרקציה על האלמנט */
}

/* סקשנים יורשים כיוון */
.section,
.container {
    direction: inherit;
}

/* יישור כללי לפי כיווניות */
body[data-dir="rtl"] .section,
body[data-dir="rtl"] .container,
body[data-dir="rtl"] input {
    text-align: right;
}

body[data-dir="ltr"] .section,
body[data-dir="ltr"] .container,
body[data-dir="ltr"] input {
    text-align: left;
}

/* ✅ כל הפסקאות בכל סקשן – תמיד במרכז */
section p {
    text-align: center !important;
}

/* רקע מונפש */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.05;
    z-index: -1;
    animation: move 20s linear infinite;
}

@keyframes move {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100px 100px;
    }
}

/* מבנה סקשן */
.section {
    padding: 50px 20px 30px;
    max-width: 700px;
    margin: auto;
    text-align: center;
}

#about {
    padding-top: 90px !important;
    padding-bottom: 30px;
}

.container {
    background-color: var(--container-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--text-color);
}

/* תמונת פרופיל */
.profile-img {
    display: block;
    margin: 0 auto 20px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 5px var(--accent), 0 0 10px rgba(160, 32, 240, 0.5);
}

/* כותרות */
h1,
h2 {
    text-align: center;
    color: var(--accent);
    text-shadow: 0 0 3px var(--accent), 0 0 6px rgba(160, 32, 240, 0.4);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

h2 {
    margin-bottom: 20px;
}

/* תיאור */
p.description {
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* רשתות חברתיות */
.socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.socials a {
    color: var(--accent);
    font-size: 1.5em;
    transition: transform 0.2s;
    text-shadow: 0 0 3px var(--accent), 0 0 6px rgba(160, 32, 240, 0.4);
}

.socials a:hover {
    transform: scale(1.2);
}

/* שדה טקסט */
form input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 2px solid var(--accent);
    border-radius: var(--border-radius);
    font-size: 1em;
    background-color: var(--container-bg);
    box-shadow: 0 0 5px var(--accent), 0 0 8px rgba(160, 32, 240, 0.5);
    transition: box-shadow 0.3s, border-color 0.3s;
}

form input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 8px var(--accent), 0 0 14px rgba(160, 32, 240, 0.6);
}

/* כפתור שליחה */
button {
    display: block;
    margin: 0 auto;
    padding: 12px 25px;
    background: var(--accent);
    color: var(--container-bg);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 0 5px var(--accent), 0 0 10px rgba(160, 32, 240, 0.5);
}

button:hover {
    transform: scale(1.05);
}

/* 📁 Projects – תמיד מרכז */
#projects .container,
#projects .project-card,
#projects .project-card h3,
#projects .project-card p {
    text-align: center !important;
}

#projects .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    justify-items: center;
}

.project-card {
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: 0 0 5px var(--accent), 0 0 10px rgba(160, 32, 240, 0.4);
}

/* ביקורות */
.review {
    display: none;
    align-items: center;
    gap: 15px;
    text-align: left;
    padding: 15px;
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 0 5px var(--accent), 0 0 8px rgba(160, 32, 240, 0.3);
    font-style: italic;
    font-size: 1.05em;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.review.show {
    display: flex;
    opacity: 1;
}

.review img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 5px var(--accent), 0 0 8px rgba(160, 32, 240, 0.5);
}

/* פוטר */
footer {
    margin-top: 60px;
    font-size: 0.85em;
    color: gray;
    text-align: center;
    padding: 20px;
}

/* כפתור וואטסאפ */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    padding: 11px 14px;
    font-size: 22px;
    box-shadow: 0 0 5px var(--accent), 0 0 8px rgba(160, 32, 240, 0.4);
    z-index: 1000;
}

/* 🔁 אנימציות טופ-בר */
@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.top-bar span.anim-out {
    animation: slideOutRight 0.2s ease forwards;
}

.top-bar span.anim-in {
    animation: slideInLeft 0.2s ease forwards;
}