/* === משתנים גלובליים (Global Variables) === */
:root {
    --neon-blue: #43a1ac;
    --neon-pink: #ff0055;
    --neon-purple: #000000;
    --dark-bg: #dadae2fa;
    --darker-bg: #ffffff;
    --panel-bg: rgba(250, 250, 255, 0.92);
    --border-glow: 0 0 8px rgba(0, 229, 255, 0.4);
    --text-glow: 0 0 4px rgba(0, 229, 255, 0.3);
    --text-color-primary: #141212;
    --text-color-secondary: #1a1717;
    --border-color-subtle: rgba(0, 229, 255, 0.2);
    --neon-blue-glow: rgba(0, 229, 255, 0.5);
    --neon-pink-glow: rgba(255, 0, 85, 0.5);
    --neon-purple-glow: rgba(122, 0, 255, 0.5);
}

/* === סגנונות בסיסיים לגוף האתר (Basic Body Styles) === */
body {
    background-color: var(--darker-bg);
    color: var(--text-color-primary);
    font-family: 'Rubik', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    direction: rtl;
    line-height: 1.7;
    font-size: 1.05rem;
}

h1, h2, h3, .cyber-logo, .featured-title, .stats-number {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

/* === מיכל ראשי (Main Container) === */
.cyber-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 1300px;
    margin: 40px auto;
    padding: 20px 40px;
    direction: rtl;
}

/* === כותרת עליונה של האתר (Header of the Website) === */
.cyber-header {
    background-color: var(--dark-bg);
    padding: 12px 0;
    border-bottom: 1px solid var(--neon-blue);
    box-shadow: 0 1px 8px rgba(0, 229, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cyber-header.header-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* === מיכל הניווט בתוך ההאדר (Navigation Container within the Header) === */
.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 10px;
}

/* === לוגו (Logo) === */
.cyber-logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue-glow);
    letter-spacing: 2px;
    padding: 0;
}

/* === קישורי ניווט (Navigation Links) === */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-color-primary);
    text-decoration: none;
    padding: 8px 16px;
    transition: all 0.3s ease-in-out;
    font-weight: 400;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    
}

.nav-link:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px rgba(247, 245, 245, 0.2);
    color: var(--neon-pink);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(253, 253, 253, 0.15);
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px rgba(255, 254, 254, 0.4);
    color: var(--neon-purple);
    font-weight: 500;
    transform: scale(1.01);
}

/* === תיבת חיפוש (Search Box) === */
.search-box {
    background-color: var(--darker-bg);
    border: 1px solid var(--neon-blue);
    color: var(--text-color-primary);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 180px;
}

.search-box::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.6;
}

.search-box:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.3);
    width: 220px;
}

/* === המבורגר מנו (Hamburger Menu) === */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1002;
    transition: transform 0.3s ease;
}

.hamburger-menu:focus {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: var(--neon-blue);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 5px var(--neon-blue-glow);
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background-color: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink-glow);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
    background-color: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink-glow);
}

/* === תפריט נפתח (Dropdown Navigation) === */
.dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    line-height: normal;
}

.dropdown-content {
    display: block;
    position: absolute;
    background-color: var(--dark-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.4);
    z-index: 1001;
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    overflow: hidden;
    right: 0;
    padding: 8px 0;
    top: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;
}

.dropdown-content a {
    color: var(--text-color-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: right;
    font-size: 0.95rem;
    transition: all 0.3s ease-in-out;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(0, 229, 255, 0.15);
    color: var(--neon-blue);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.5);
    transform: translateX(-5px);
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-toggle {
    animation: none !important;
    padding: 8px 16px;
    box-sizing: border-box;
}

/* === סגנון סקשן (Section Style) === */
.cyber-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.1);
    padding: 35px;
    border: 1px solid var(--border-color-subtle);
    position: relative;
}

/* === כותרת סקשן (Section Title) === */
.section-title {
    font-size: 2.4rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue-glow);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--neon-blue);
    text-align: right;
    position: relative;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -4px;
    width: 80px;
    height: 4px;
    background: var(--neon-pink);
    border-radius: 2px;
}

/* === גריד לכרטיסים (Card Grid) === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* === סגנון כרטיס (Card Style) === */
.cyber-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color-subtle);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
    padding: 22px;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cyber-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
    border-color: var(--neon-blue);
}

.card-content {
    flex-grow: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
}

.card-header {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--neon-pink);
    text-shadow: 0 0 6px var(--neon-pink-glow);
    text-align: right;
    border-bottom: 1px solid rgba(255, 0, 85, 0.2);
    padding-bottom: 10px;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 1px solid var(--border-color-subtle);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
    border-radius: 4px;
}

.card-text {
    margin-bottom: 18px;
    line-height: 1.7;
    color: var(--text-color-secondary);
    text-align: right;
    font-size: 0.98rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid rgba(0, 229, 255, 0.15);
    padding-top: 15px;
    font-size: 0.88rem;
    color: var(--text-color-secondary);
}

/* === מאמר מובלט (Featured Article) === */
.featured-article {
    grid-column: span 2;
    display: flex;
    gap: 35px;
    background-color: var(--panel-bg);
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
    padding: 35px;
    border-radius: 15px;
    align-items: center;
}

.featured-image {
    flex: 2;
    min-width: 300px;
    border-radius: 10px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
    border-radius: 8px;
}

.featured-content {
    flex: 3;
}

.featured-title {
    font-size: 3rem;
    color: var(--neon-pink);
    text-shadow: 0 0 15px var(--neon-pink-glow);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: 1.5px;
}

/* === אפקטים זוהרים (Glow Effects) === */
.glow-text {
    color: var(--neon-blue);
    text-shadow: var(--text-glow);
}

.glow-border {
    border: 1px solid var(--neon-blue);
    box-shadow: var(--border-glow);
}

/* === וידג'ט סטטיסטיקה (Stats Widget) === */
.stats-widget {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--panel-bg);
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 15px rgba(122, 0, 255, 0.3);
    padding: 25px;
    margin-bottom: 50px;
    border-radius: 12px;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    flex: 1;
    text-align: center;
}

.stats-item:not(:last-child) {
    border-left: 1px solid rgba(122, 0, 255, 0.2);
}

.stats-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--neon-purple);
    text-shadow: 0 0 12px var(--neon-purple-glow);
    margin-bottom: 8px;
}

.stats-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-color-secondary);
}

/* === ניווט גיבוי (Fallback Navigation) === */
.fallback-navigation {
    border: 2px solid var(--neon-pink);
    background-color: rgba(255, 0, 85, 0.1);
}

.fallback-navigation::before {
    content: "⚠️ Fallback Navigation - Header loading failed";
    display: block;
    background-color: var(--neon-pink);
    color: white;
    padding: 5px 10px;
    font-size: 0.8rem;
    text-align: center;
    margin-bottom: 10px;
}

/* === התאמות למסכים בינוניים (Medium Screen Adjustments) === */
@media (max-width: 1024px) {
    .cyber-container {
        max-width: 960px;
        gap: 40px;
    }
    
    .featured-article {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-image {
        min-width: unset;
        width: 85%;
        margin: 0 auto 25px auto;
    }
    
    .featured-content {
        text-align: right;
    }
    
    .nav-container {
        padding: 0 25px;
    }
    
    .cyber-logo {
        font-size: 2rem;
    }
}

/* === Mobile Navigation Styles (סגנונות ניווט מובייל) === */
@media (max-width: 768px) {
    .cyber-header {
        padding: 8px 0;
        border-bottom: 1px solid rgba(0, 229, 255, 0.3);
        box-shadow: 0 1px 5px rgba(0, 229, 255, 0.1);
    }

    .nav-container {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        padding: 8px 15px;
        height: 45px;
    }

    .hamburger-menu {
        display: flex;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
        width: 26px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-direction: column;
        justify-content: space-between;
    }

    .hamburger-menu .bar {
        width: 100%;
        height: 2px;
        background-color: var(--neon-blue);
        border-radius: 1px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 0 0 3px var(--neon-blue-glow);
    }

    .cyber-logo {
        margin: 0;
        font-size: 1.6rem;
        font-weight: 500;
        letter-spacing: 1.5px;
    }

    .search-box {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        padding: 0;
        border-radius: 50%;
        background: transparent;
        border: 1px solid var(--neon-blue);
        color: var(--neon-blue);
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-indent: -9999px;
    }

    .search-box::before {
        content: "🔍";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        font-size: 12px;
    }

    .search-box:focus {
        width: 140px;
        height: 32px;
        border-radius: 16px;
        padding: 6px 12px;
        text-indent: 0;
        background: var(--darker-bg);
        left: 8px;
        border-width: 1px;
    }

    .search-box:focus::before {
        display: none;
    }

    .search-box:focus::placeholder {
        color: var(--text-color-secondary);
        font-size: 0.85rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
        backdrop-filter: blur(10px);
        border-left: 1px solid var(--neon-blue);
        box-shadow: -3px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 1001;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 60px 0 20px 0;
        gap: 0;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
    }

    .nav-links.nav-open {
        right: 0;
    }

    .nav-links.nav-open::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 70%;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(3px);
        z-index: -1;
    }

    .nav-link {
        display: block;
        padding: 12px 20px;
        margin: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 229, 255, 0.08);
        font-size: 1rem;
        font-weight: 400;
        text-align: right;
        background: transparent;
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        background: rgba(0, 229, 255, 0.08);
        border-color: var(--neon-blue);
        transform: translateX(-8px);
        box-shadow: inset 3px 0 0 var(--neon-blue);
    }

    .nav-link.active {
        background: rgba(255, 0, 85, 0.15);
        color: var(--neon-pink);
        border-color: var(--neon-pink);
        box-shadow: inset 3px 0 0 var(--neon-pink);
        transform: none;
        font-weight: 500;
    }

    .dropdown {
        position: relative;
        width: 100%;
    }

    .dropdown-toggle {
        position: relative;
        font-size: 1rem;
        padding: 12px 20px;
    }

    .dropdown-toggle::after {
        content: "▼";
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }

    .dropdown:hover .dropdown-toggle::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .dropdown-content {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        border-radius: 0;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
        max-height: 0;
        overflow: hidden;
    }

    .dropdown:hover .dropdown-content {
        max-height: 250px;
    }

    .dropdown-content a {
        padding: 10px 35px;
        border-bottom: 1px solid rgba(0, 229, 255, 0.05);
        background: rgba(0, 229, 255, 0.02);
        font-size: 0.9rem;
        font-weight: 300;
    }

    .dropdown-content a:hover {
        background: rgba(0, 229, 255, 0.1);
        transform: translateX(-3px);
    }

    /* התאמות רספונסיביות כלליות */
    .cyber-container {
        gap: 30px;
        padding: 15px;
        margin: 20px auto;
    }

    .cyber-section {
        padding: 25px;
        gap: 20px;
    }

    .section-title {
        font-size: 1.9rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .section-title::after {
        width: 50px;
        height: 3px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .cyber-card {
        padding: 20px;
    }

    .card-header {
        font-size: 1.4rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .card-image {
        height: 160px;
        margin-bottom: 12px;
    }

    .card-text {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .card-footer {
        padding-top: 12px;
        font-size: 0.8rem;
    }

    .featured-article {
        padding: 25px;
        gap: 20px;
        flex-direction: column;
    }

    .featured-title {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .featured-image {
        width: 90%;
    }

    .stats-widget {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        margin-bottom: 30px;
    }

    .stats-item {
        width: 100%;
        border-left: none !important;
        border-bottom: 1px solid rgba(122, 0, 255, 0.2);
        padding-bottom: 15px;
    }

    .stats-item:last-child {
        border-bottom: none !important;
    }

    .stats-number {
        font-size: 2.8rem;
    }
}

/* === Enhanced Mobile Responsive (שיפורים רספונסיביים נוספים) === */
@media (max-width: 480px) {
    .cyber-header {
        padding: 6px 0;
    }

    .nav-container {
        height: 40px;
        padding: 6px 12px;
    }

    .nav-links {
        width: 85%;
    }

    .nav-links.nav-open::before {
        right: 85%;
    }

    .cyber-logo {
        font-size: 1.4rem;
        font-weight: 500;
        letter-spacing: 1px;
    }

    .hamburger-menu {
        width: 24px;
        height: 18px;
        right: 12px;
    }

    .hamburger-menu .bar {
        height: 1.5px;
    }

    .search-box {
        width: 28px;
        height: 28px;
        left: 12px;
    }

    .search-box::before {
        font-size: 10px;
    }

    .search-box:focus {
        width: 110px;
        height: 30px;
        padding: 5px 10px;
        left: 6px;
        border-radius: 15px;
    }

    .nav-link {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .dropdown-content a {
        padding: 8px 30px;
        font-size: 0.85rem;
    }
}

/* === אנימציות (Animations) === */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.005);
    }
}

.cyber-logo, .featured-title, .card-header {
    animation: pulse 2.8s infinite ease-in-out;
}

/* === פס גלילה מותאם אישית (Custom Scrollbar) === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border: 1px solid rgba(0, 229, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
    box-shadow: 0 0 6px var(--neon-pink);
}

/* === Footer === */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    background-color: var(--dark-bg);
    border-top: 1px solid var(--border-color-subtle);
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.8px;
}

/* === General Link Styling === */
a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 6px var(--neon-pink);
}

/* === התאמות נגישות (Accessibility Improvements) === */
@media (prefers-reduced-motion: reduce) {
    .hamburger-menu .bar,
    .nav-links,
    .dropdown-content,
    .cyber-header {
        transition: none;
    }
    
    .cyber-header {
        opacity: 1;
        transform: none;
    }
    
    .cyber-logo, .featured-title, .card-header {
        animation: none;
    }
}

/* === תמיכה במצב ניגודיות גבוהה (High Contrast Mode Support) === */
@media (prefers-contrast: high) {
    .hamburger-menu .bar {
        background-color: #ffffff;
        box-shadow: none;
    }
    
    .nav-links {
        background: #000000;
        border-left-color: #ffffff;
    }
    
    .nav-link {
        color: #ffffff;
        border-bottom-color: #666666;
    }
}

/* === שיפורי מצב כהה (Dark Mode Enhancements) === */
@media (prefers-color-scheme: dark) {
    .nav-links {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    }
    
    .dropdown-content {
        background: rgba(0, 0, 0, 0.9);
    }
}