/* 🌌 CASE STUDIES STYLES - OPTIMIZED VERSION */

/* Base Layout Fixes */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Case Navigation */
/* 🔧 FIXED MOBILE HEADER - NO BLUR, PROPER POSITIONING */
/* 🔧 MOBILE MENU FOR CASE STUDIES - SAME AS MAIN PAGE */
.case-nav {
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.case-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.back-home-link {
    text-decoration: none;
    color: #e0e0e0;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-home-link:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.2);
    transform: translateY(-2px);
    background: rgba(255, 230, 0, 0.08);
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.15);
}

/* 🔧 MOBILE MENU TOGGLE - SAME AS MAIN PAGE */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: 0.5rem;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* 🔧 MOBILE MENU STYLES */
@media screen and (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .case-nav ul {
        flex-direction: column;
        display: none;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        padding: 5rem 1rem 2rem;
        z-index: 999;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        margin: 0;
    }
    
    .case-nav ul.active {
        display: flex;
    }
    
    .case-nav ul li {
        margin: 0;
        width: 100%;
        max-width: 300px;
    }
    
    .back-home-link {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.2rem;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }
    
    .back-home-link:hover,
    .back-home-link.active {
        background: rgba(255, 230, 0, 0.1);
        border-color: var(--primary);
        transform: translateY(-2px);
    }
    
    /* Close button style when menu is open */
    .case-nav ul.active ~ .menu-toggle {
        background: rgba(255, 100, 100, 0.9);
    }
    
    /* Adjust hero section for mobile */
    .case-hero {
        padding-top: 1rem !important;
    }
}

/* Body scroll lock when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}


/* Case Hero Section */
/* Case Hero Section - MOBILE FIX */
.case-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    padding: 1rem 1rem 3rem;
    min-height: 70vh;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.case-hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    padding: 0 1rem;
}

.case-hero-text h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--neon), var(--nebula-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s ease infinite;
    background-size: 200% 200%;
    text-shadow: 0 0 20px rgba(255, 230, 0, 0.2);
    line-height: 1.2;
}

.case-hero-text p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 0;
    opacity: 0.9;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

/* Case Navigation - REMOVE BORDERS */
.case-navigation {
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    /* REMOVED BORDERS: */
    /* border-top: 1px solid rgba(255, 255, 255, 0.1); */
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
    flex: 1;
    min-width: 140px;
    justify-content: center;
    /* REMOVE OUTLINE ON FOCUS */
    outline: none;
}

.nav-btn:focus {
    outline: none;
    border-color: var(--primary);
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 230, 0, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 230, 0, 0.3);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.case-counter {
    color: var(--primary);
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
    min-width: 60px;
    text-align: center;
    padding: 0 1rem;
}

/* Back Home Link - MOBILE STYLES */
.back-home-link {
    text-decoration: none;
    color: #e0e0e0;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-home-link:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.2);
    transform: translateY(-2px);
    background: rgba(255, 230, 0, 0.08);
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.15);
}

/* Mobile specific styles */
@media (max-width: 768px) {
    .case-hero {
        padding: 0.5rem 1rem 2rem;
        min-height: 60vh;
        gap: 1.5rem;
    }
    
    .case-hero-text h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .case-hero-text p {
        font-size: 1.1rem;
    }
    
    .hero-planet {
        width: 150px;
        height: 150px;
    }
    
    .back-home-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
        position: absolute;
        top: 1rem;
        left: 1rem;
        z-index: 100;
    }
    
    .case-nav {
        margin-bottom: 1rem;
        padding-top: 4rem;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 280px;
        padding: 0.7rem 1rem;
    }
    
    .case-counter {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .case-hero {
        min-height: 50vh;
        padding: 0.5rem 0.5rem 1.5rem;
    }
    
    .case-hero-text h1 {
        font-size: 1.8rem;
    }
    
    .case-hero-text p {
        font-size: 1rem;
    }
    
    .hero-planet {
        width: 120px;
        height: 120px;
    }
    
    .back-home-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.7rem;
        top: 0.8rem;
        left: 0.8rem;
    }
    
    .nav-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.9rem;
    }
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 230, 0, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 230, 0, 0.3);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.case-counter {
    color: var(--primary);
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
    min-width: 60px;
    text-align: center;
    padding: 0 1rem;
}

/* Case Studies Content */
.case-studies-content {
    padding: 2rem 0 4rem;
    min-height: 60vh;
    flex: 1;
}

.case-study {
    display: none;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 1rem;
}

.case-study.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
    padding-top: 1rem;
}

.case-header h2 {
    color: var(--primary);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 230, 0, 0.3);
    line-height: 1.3;
    padding-top: 0.5rem;
}

.case-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #87CEEB;
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.4);
    line-height: 1.4;
}

/* Case Grid */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.case-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.case-card:nth-child(1) { animation-delay: 0.1s; }
.case-card:nth-child(2) { animation-delay: 0.2s; }
.case-card:nth-child(3) { animation-delay: 0.3s; }
.case-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}

.case-card:hover::before {
    left: 100%;
}

.case-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 
        0 15px 35px rgba(255, 230, 0, 0.15),
        0 0 40px rgba(102, 126, 234, 0.2);
}

.case-icon {
    font-size: clamp(2.5rem, 5vw, 3rem);
    margin-bottom: 1rem;
    text-shadow: 0 0 15px currentColor;
    transition: transform 0.3s ease;
}

.case-card:hover .case-icon {
    transform: scale(1.1) rotate(5deg);
}

.case-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    line-height: 1.3;
}

.case-card p {
    line-height: 1.6;
    color: #e0e0e0;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Specific card styles */
.problem-card .case-icon { color: #ff6b6b; }
.approach-card .case-icon { color: #4ecdc4; }
.result-card .case-icon { color: #ffe66d; }
.lesson-card .case-icon { color: #6a0572; }

/* Case Details Button */
.case-details-btn {
    display: block;
    margin: 2rem auto 0;
    background: linear-gradient(135deg, var(--primary), var(--neon));
    color: #111;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.1rem);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 20px rgba(255, 230, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.case-details-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 230, 0, 0.4);
    animation: none;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
    padding: 1rem;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #001122, #000428);
    border-radius: 25px;
    padding: clamp(1.5rem, 4vw, 3rem);
    max-width: min(600px, 95vw);
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px rgba(255, 230, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--neon);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 100, 100, 0.9);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(255, 100, 100, 1);
    transform: scale(1.1) rotate(90deg);
}

.modal-body h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    line-height: 1.3;
}

.modal-body .modal-subtitle {
    color: #87CEEB;
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.4;
}

.modal-details {
    background: rgba(255, 255, 255, 0.05);
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: 15px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.modal-details h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    line-height: 1.3;
}

.modal-details p {
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.tech-tag-modal {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.tech-tag-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Footer Styles */
#footer {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    color: #e0e0e0;
}

.socials {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Star animation for case cards */
.case-card::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.8) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.6) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
    animation: starsTwinkle 2s ease-in-out infinite;
}

.case-card:hover::after {
    opacity: 0.3;
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

/* Loading animation */
@keyframes loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: loading 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .case-hero {
        padding: 1rem 1rem 3rem;
        min-height: 50vh;
    }
    
    .case-hero-text h1 {
        font-size: 2.5rem;
    }
    
    .case-hero-text p {
        font-size: 1.2rem;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .case-header {
        margin-bottom: 2rem;
        padding-top: 0.5rem;
    }
    
    .case-header h2 {
        font-size: 2rem;
    }
    
    .case-subtitle {
        font-size: 1.1rem;
    }
    
    .case-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .case-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
        margin: 0.5rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .case-header h2 {
        font-size: 1.8rem;
    }
    
    .case-card {
        padding: 1.2rem;
    }
    
    .case-icon {
        font-size: 2.5rem;
    }
    
    .nav-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .back-home-link {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .case-details-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem 1rem;
    }
    
    .modal-details {
        padding: 1.2rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .case-card:hover {
        transform: none;
    }
    
    .nav-btn:hover:not(:disabled) {
        transform: none;
    }
    
    .case-details-btn:hover {
        transform: none;
    }
    
    .case-card::before,
    .case-card::after {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .case-card {
        border: 2px solid var(--primary);
    }
    
    .nav-btn {
        border: 2px solid var(--primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .case-card,
    .nav-btn,
    .case-details-btn {
        transition: none;
    }
}

/* Scroll prevention for modal */
body.modal-open {
    overflow: hidden;
}

/* 🔧 FIX FOR MOBILE HEADER IN CASE STUDIES */
.case-nav {
    position: relative;
    z-index: 1000;
}

.back-home-link {
    position: relative !important;
    z-index: 1001 !important;
}

/* Mobile specific fixes for case studies */
@media (max-width: 768px) {
    .case-hero {
        padding-top: 4rem !important;
        margin-top: 0 !important;
    }
    
    .case-nav {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        padding: 1rem;
        z-index: 1000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .case-nav ul {
        margin-bottom: 0 !important;
        justify-content: flex-start !important;
    }
    
    .back-home-link {
        position: static !important;
        font-size: 0.9rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .header-container {
        padding-top: 0 !important;
    }
    
    .hero-content.case-hero {
        margin-top: 2rem !important;
    }
}

/* Ensure content is not hidden behind fixed nav */
@media (max-width: 768px) {
    .main-content {
        padding-top: 60px; /* Висота навігації */
    }
    
    .case-studies-content {
        padding-top: 0 !important;
    }
}

/* 🔧 REMOVE TOP SPACING FOR CASE STUDIES */
.case-nav {
    margin-bottom: 0 !important;
    padding-top: 0 !important;
}

.header-container {
    padding-top: 0 !important;
}

/* 🔧 REMOVE ANY BACKGROUND/BORDER FROM NAV */
.case-nav {
    background: transparent !important;
    border: none !important;
}

/* 🔧 ENSURE HERO TAKES FULL SPACE */
.case-hero {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 🔧 MOBILE FIX - REMOVE ANY SPACING */
@media screen and (max-width: 768px) {
    .case-nav {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .case-hero {
        padding-top: 0.5rem !important;
    }
    
    /* Ensure menu toggle is properly positioned */
    .menu-toggle {
        top: 1rem;
        right: 1rem;
    }
}

/* 🔧 REMOVE ANY UNWANTED BORDERS/SHADOWS */
.nav.case-nav {
    box-shadow: none !important;
    border: none !important;
}

/* 🔧 ENSURE CONTENT STARTS FROM TOP */
#header {
    padding-top: 0 !important;
}

/* 🌌 CASE STUDIES SPACING OPTIMIZATION */

/* Base spacing adjustments - NO RESETS to preserve design */
.case-hero {
    padding: 1rem 1rem 2rem !important;
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Desktop optimization - move content down */
@media (min-width: 769px) {
    .case-hero {
        padding: 4rem 1rem 3rem !important;
        min-height: 55vh;
    }
    
    .case-hero-text {
        margin-top: -3rem;
    }
    
    .hero-planet {
        margin-top: 2rem;
    }
    
    .case-navigation {
        margin-top: -5rem !important;
        padding: 1rem 0 1.5rem !important;
    }
}

/* Mobile stays mostly the same */
@media (max-width: 768px) {
    .case-hero {
        padding: 5rem 1rem 2rem !important;
        min-height: 70vh;
    }
    
    .case-hero-text h1 {
        margin-bottom: 0.8rem;
    }
}

/* 🔧 FIX CLICKABLE BUTTONS */
.case-navigation {
    position: relative;
    z-index: 10 !important; /* Lower z-index */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    pointer-events: none; /* Allow clicks to pass through */
}

/* But buttons should be clickable */
.nav-buttons {
    pointer-events: auto !important;
    position: relative;
    z-index: 20 !important;
}

.nav-btn {
    position: relative;
    z-index: 30 !important;
}

/* Content should be above navigation */
.case-studies-content {
    padding: 2rem 0 3rem !important;
    position: relative;
    z-index: 5 !important; /* Lower than navigation buttons */
}

/* Ensure case study content is clickable */
.case-study {
    position: relative;
    z-index: 1 !important;
}

.case-details-btn {
    position: relative;
    z-index: 10 !important;
}

/* Remove any specific conflicts */
.header-container {
    padding-bottom: 0 !important;
}

.main-content {
    overflow: visible !important;
}

/* Ensure cosmic background covers properly */
.cosmic-background {
    z-index: 1;
}

.case-hero {
    position: relative;
    z-index: 2;
}

/* Smooth transitions for any adjustments */
.case-hero-text,
.hero-planet {
    transition: margin 0.3s ease;
}

/* Ensure all interactive elements are clickable */
.nav-buttons,
.nav-btn,
.case-details-btn,
.case-card {
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

