/* New Main Styles */

:root {
    --primary-color: #5D0070; /* Purple */
    --secondary-color: #7310EA; /* Light purple */
    --purple-blue-color: #3D0092; /* Blue-ish purple */
    --purple-dark-color: #36003B; /* Darker purple */
    --accent-color: #EED416; /* Yellow */
    --accent-color-90: rgba(238, 212, 22, 0.85);; /* Yellow */
    
    --accent-blue-color: #08FFFF; /* Yellow */
    --dark-color: #121212; /* Near-black for text */
    --light-color: #F8F9FA; /* Off-white background */
    --gray-color: #757575; /* Medium gray for secondary text */
    --light-gray: #E0E0E0; /* Light gray for borders and dividers */
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08); /* Deeper shadow for cards */
    
    --header-height: 66px;
    --transition-speed: 0.3s;
    
    /* Gradient variables for matched sectors */
    --repeating-conic-gradient-times: 5;
    --gradient: 
        radial-gradient(circle, rgb(242, 23, 165) 10%, #dd7bbb00 20%), 
        radial-gradient(circle at 40% 40%, rgb(255, 182, 13) 5%, #d79f1e00 15%), 
        radial-gradient(circle at 60% 60%, rgb(122, 255, 13) 10%, #5a922c00 20%), 
        radial-gradient(circle at 40% 60%, rgb(51, 5, 255) 10%, #4c789400 20%), 
        repeating-conic-gradient(
            from 236.84deg at 50% 50%, 
            #dd7bbb 0%, 
            #d79f1e calc(25% / var(--repeating-conic-gradient-times)), 
            #5a922c calc(50% / var(--repeating-conic-gradient-times)), 
            #4c7894 calc(75% / var(--repeating-conic-gradient-times)), 
            #dd7bbb calc(100% / var(--repeating-conic-gradient-times))
                );

    --active: 0;
    --start: 0;
}

body {
    background-color: var(--accent-color); /* Yellow background to match the phone frame */
    color: var(--dark-color);
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--primary-color);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--primary-color);
}


/* Common Elements */
button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

button:hover {
    /* background-color: #2a75f0; */
}

/* Slider segment hover effect */
.slider-segment:hover {
    background-color: var(--secondary-color);
}

.hidden {
    display: none !important;
    visibility: hidden !important;
}








/* Main View */
#main-view {
    min-height: 100vh;
    padding-bottom: var(--header-height);
    background-color: #1E0030; /* Dark purple background for the main view */
}

main header {
    height: var(--header-height);
    background-color: #1E0030; /* Rich deep purple background */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--accent-color);
}

.header-logo {
    height: 36px;
    margin-right: auto;
    cursor: pointer;
}

@media (min-width: 768px) {
    main header {
        height: calc(var(--header-height) + 10px);
    }
    .header-logo {
        height: 50px;
    }
}

/* About Button */
.about-btn, .newsletter-btn {
    background-color: transparent;
    border: none;
    padding: 8px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.about-btn img, .newsletter-btn img {
    height: 26px;
    width: 26px;
}

@media (min-width: 768px) {
    .about-btn:hover,
    .newsletter-btn:hover,
    .close-about:hover,
    .close-newsletter:hover {
        transform: scale(1.1);
    }
}

/* About Popup */
#about-popup, #newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.about-container, .newsletter-container {
    text-align: center;
    background: linear-gradient(to bottom, var(--secondary-color), var(--purple-dark-color));
    border: 2px solid var(--accent-blue-color);
    padding: 30px 28px;
    border-radius: 22px;
    max-width: 90%;
    width: 400px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.about-container::before, .newsletter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/dithers/dithered_stars.jpg');
    background-size: contain;
    background-position: center;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.about-container h2, .newsletter-container h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    color: var(--accent-color);
}

.about-container a, .newsletter-container a {
    text-decoration: underline;
}

.about-text, .newsletter-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    color: white;
    margin-bottom: 20px;
}

.close-about, .close-newsletter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    z-index: 3;
}

.close-about img, .close-newsletter img {
    width: 20px;
    height: 20px;
}

/* Newsletter Form Styles */
#email-form {
    position: relative;
    z-index: 2;
    margin-bottom: 15px;
}

#email-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 15px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

#email-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#subscribe-btn {
    width: 100%;
    font-size: 14px;
}

.success-message, .error-message {
    font-family: 'Inter', sans-serif;
    padding: 8px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 12px;
    z-index: 2;
    position: relative;
}

.success-message {
    background-color: rgba(0, 128, 0, 0.2);
    border: 1px solid rgba(0, 128, 0, 0.4);
    color: #88ff88;
}

.error-message {
    background-color: rgba(128, 0, 0, 0.2);
    border: 1px solid rgba(128, 0, 0, 0.4);
    color: #ff8888;
}

#filter-toggle {
    background-color: transparent;
    color: var(--accent-color);
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    display: flex;
    align-items: center;
}

/* Sectors Grid */
#sectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
    position: relative;
    z-index: 1;
    margin-top: 10px;
    top: var(--header-height);
}

.sector-item {
    background-color: transparent;
    border-radius: 20px; /* More rounded corners like in mockup */
    /* overflow: hidden; */
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s, filter 0.3s, outline 0.3s;
    position: relative;
    height: auto; /* Let content determine height */
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    padding-bottom: 36px; /* Add padding at the bottom to make room for the title bar */
    border: 2px solid rgba(0, 0, 0, 0);
}

.sector-item:hover {
    box-shadow: 0px 0px 10px var(--secondary-color);
}

.sector-thumb {
    height: 170px; /* Fixed height for consistent card size */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    width: 100%; /* Ensure full width */
    border-radius: 20px 20px 0 0; /* Match the card border radius */
}

.sector-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    /* border-radius: 20px;  */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth transition for hover effects and loading */
}

/* Thumbnail loading states */
.sector-thumb img.lazy-thumb:not([src]) {
    opacity: 0.8;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.sector-thumb img.lazy-thumb {
    transition: opacity 0.4s ease;
}

.sector-thumb img.thumb-loaded {
    opacity: 1;
}

.sector-details {
    padding: 6px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--accent-color); /* Yellow background for the title area */
    height: auto; /* Auto height instead of fixed */
    min-height: 40px; /* Minimum height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 2px solid rgba(0, 0, 0, 0.1); /* Subtle separation */
    border-radius: 0 0 20px 20px; /* Round bottom corners to match card */
    z-index: 6; /* Increased to be above the faded overlay (z-index: 4) */
    transition: background-color 0.3s ease; /* Smooth transition for background color change */
}

/* Viewed sector styles */
.sector-details.viewed {
    background-color: var(--secondary-color); /* Change background to secondary color for viewed sectors */
}

.sector-details h3 {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 900; /* Extra bold */
    text-align: center;
    color: var(--primary-color); /* Purple text on yellow background */
    line-height: 1; /* Tighter line spacing */
    text-transform: uppercase;
    margin: 0; /* Remove any margins */
    padding: 0 2px;
    transition: color 0.3s ease;
}

/* Adjust text color for viewed sectors */
.sector-details.viewed h3 {
    color: var(--light-color); /* Light color text for better contrast on secondary color */
}

/* Faded item styles */
.sector-item.faded {
    position: relative;
    overflow: hidden; /* Default is hidden */
    border: 2px solid var(--primary-color);
    cursor: pointer;
}

/* When sector-package is visible, make .sector-item.faded overflow visible */
.sector-item.faded.package-visible {
    overflow: visible;
    cursor: default;
}

/* When sector-package is hidden, keep .sector-item.faded overflow hidden */
.sector-item.faded.package-hidden {
    overflow: hidden;
}

.sector-item.faded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/dithers/dither_2.png');
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 4;
    mix-blend-mode: overlay;
}

.sector-item.faded::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--purple-dark-color);
    mix-blend-mode: darken;
    opacity: 0.65;
    z-index: 11;
}

.sector-item.faded .sector-thumb img,
.sector-item.faded .sector-details {
    filter: blur(3px); /* Reduced blur for better readability */
    z-index: 3;
    opacity: 0.8; /* Slightly more visible */
}

/* Ensure the faded effect doesn't mess with the absolute positioning */
.sector-item.faded .sector-details {
    position: absolute;
    bottom: 0;
}

/* Non-faded item styles */
.sector-item:not(.faded) {
    z-index: 2; /* Higher z-index for visible items */
    cursor: pointer;
    transform: translateZ(0); /* Force hardware acceleration for smoother transitions */
    outline: 1px solid transparent;
    outline-offset: -1px;
    position: relative;
}

.sector-item:not(.faded)::before {
    content: '';
    position: absolute;
    inset: 0px;
    padding: 2px;
    border-radius: 20px;
    background: var(--accent-color);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 4;
    filter: saturate(150%) contrast(110%);
}

.sector-item:not(.faded):hover::before {
    background: var(--gradient);
}

/* Remove existing paragraph styles since we no longer use them */
.sector-details p {
    display: none;
}

/* Sector Detail View */
#sector-detail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 200;
    display: none;
    /* overflow-y: auto; */
    align-items: center;
}

#sector-detail.visible {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
    padding: 0 10px;
    min-height: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.card-wrapper {
    position: relative;
    padding: 8px;
    margin: 0 auto 20px;
    max-width: 100%;
    width: calc(100% - 8px);
    background: linear-gradient(135deg, #5E0070, #4b0082, #1E0030);
    border-radius: 20px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5), 0 0 8px rgba(156, 106, 255, 0.3);
    overflow: visible; /* Ensure this is set to visible for the close button */
    align-self: center;
}

.card-gradient {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    margin: auto;
    overflow: visible;
    align-self: center;
    border-radius: 20px;
    background: var(--gradient);
    pointer-events: none;
    z-index: 0;
    filter: saturate(150%) contrast(110%) blur(30px);
    opacity: 0.6;
} 


@media (min-width: 768px) {
    .card-gradient {
        width: 50%;
        height: 85%;
        filter: blur(80px);
        opacity: 0.7;
    }
}



.card-wrapper::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 18px;
    background-image: url("data:image/svg+xml,%3Csvg width='800' height='800' viewBox='0 0 800 800' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ff45d1' stroke-width='2'%3E%3Cpath d='M0 0h800M0 100h800M0 200h800M0 300h800M0 400h800M0 500h800M0 600h800M0 700h800M0 800h800M100 0v800M200 0v800M300 0v800M400 0v800M500 0v800M600 0v800M700 0v800'/%3E%3Cpath d='M50 50l700 700M50 150l700 700M50 250l700 700M50 350l700 700M50 450l700 700M50 550l700 700M50 650l700 700M150 50l700 700M250 50l700 700M350 50l700 700M450 50l700 700M550 50l700 700M650 50l700 700'/%3E%3Cpath d='M750 50l-700 700M750 150l-700 700M750 250l-700 700M750 350l-700 700M750 450l-700 700M750 550l-700 700M750 650l-700 700M650 50l-700 700M550 50l-700 700M450 50l-700 700M350 50l-700 700M250 50l-700 700M150 50l-700 700'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: 1;
    z-index: 0;
    /* animation: gridMove 20s linear infinite; */
    filter: drop-shadow(0 0 1rem #ff45d1);
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 150px 150px;
    }
}


/* Card view styling */
.card-view {
    background: linear-gradient(to bottom, #488CFC, #7509E9);
    border: 1px solid var(--accent-color);
    border-radius: 16px;
    overflow: visible; /* Changed from hidden to visible to allow tooltips to overflow */
    position: relative;
    animation: cardAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

@keyframes cardAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.card-header {
    /* background-color: var(--accent-color); */
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 900;
    background-color: var(--accent-color)   ;
    color: var(--dark-color);
    padding: 4px 6px;
    border-radius: 8px;
    border: 2px solid var(--dark-color);
    line-height: 1;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: -0.5px;
    max-width: calc(100% - 70px)
}

.card-id {
    color: #fff;
    font-size: 12px;
    font-family: 'Press Start 2P', cursive;
    transform-origin: right center;
    margin-left: 10px;
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%) scale(0.85);
    z-index: 10;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

@media screen and (min-width: 768px) {
    .card-title {
        font-size: 15px;
        max-width: calc(100% - 84px)
    }
    .card-id {
        font-size: 14px;
    }
}

.card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    margin: 0 6px;
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    position: relative;
    width: calc(100% - 12px); /* Mobile-first width */
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block; /* Prevent inline gaps */
}

@media (min-width: 768px) {
    .card-image {
        margin: 0 8px;
        width: calc(100% - 16px);
        aspect-ratio: 16/9;
        margin-bottom: 10px;
    }
    
    .card-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
}

.card-description {
    padding: 8px;
    color: var(--primary-color);
    font-size: 13px;
    line-height: 1.1;
    background-color: #e0ccff;
    margin: 8px;
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    position: relative;
    font-weight: 600;
    text-align: justify;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    word-break: break-word;
}

.card-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
    border-radius: 10px;
}

.card-content {
    padding: 6px 6px;
    color: white;
    border-bottom: none; /* Remove any border that might exist */
    margin-bottom: 10px;
}


.career-path {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    position: relative;
    gap: 5px
}

.career-stage {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between
}

.career-years {
    background-color: white;
    color: var(--primary-color);
    border-radius: 8px;
    padding: 4px 6px 4px 34px;
    display: inline-block;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--accent-color);
    position: relative;
    font-family: 'Oswald', sans-serif;
}

.career-years::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.career-stage:nth-child(1) .career-years::before {
    background-image: url('../assets/icons/stage_icon_1.png');
}

.career-stage:nth-child(2) .career-years::before {
    background-image: url('../assets/icons/stage_icon_2.png');
}

.career-stage:nth-child(3) .career-years::before {
    background-image: url('../assets/icons/stage_icon_3.png');
}

.career-title {
    color: white;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Oswald', sans-serif;
    line-height: 1.2;
    /* margin-bottom: 6px; */
    text-transform: uppercase;
}

.career-salary {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

#close-card {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: transparent;
    width: 24px;
    height: 24px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    visibility: visible;
    opacity: 0.9;
}

@media (min-width: 768px) {
    #close-card {
        bottom: auto;
        right: -50px; /* 15px distance + 24px (button width) */
        bottom: 0px;
        transform: translateY(-50%);
        opacity: 0.6;
    }
}

#close-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#close-card:hover {
    transform: scale(1.1);
}

@media (min-width: 768px) {
    #close-card:hover {
        transform: translateY(-50%) scale(1.1);
    }
}

/* Existing sector detail styles can be kept for backwards compatibility */
#sector-detail header {
    height: var(--header-height);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
}

#back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    margin-right: 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

#back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}



.sector-content {
    padding: 16px;
}

.sector-image {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color));
    position: relative;
    height: 200px;
}

.sector-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.info-block {
    margin-bottom: 28px;
    background-color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.info-block h3 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 8px;
}

.info-block ul {
    padding-left: 16px;
}

.info-block li {
    margin-bottom: 4px;
    position: relative;
    padding-left: 16px;
}

.info-block li:before {
    content: "";
    position: absolute;
    top: 8px;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}

.sector-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    justify-content: center;
}


/* Media Queries for larger screens */
@media (min-width: 768px) {
    #sectors-grid {
        grid-template-columns: repeat(1, 1fr);
        margin-left: 520px; /* Space for the 500px filter panel + 20px gap */
        padding: 20px 20px 10px 10px;
        width: calc(100% - 520px);
    }
    
    /* Hide filter toggle button on desktop */
    #filter-toggle {
        display: none;
    }
    
}

@media (min-width: 990px) {
    #sectors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1120px) {
    #sectors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    #sectors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1800px) {
    #sectors-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 2000px) {
    #sectors-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.card-icon-building {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
}

.sector-details.long-title h3 {
    font-size: 14px;
}

.sector-details.long-title {
    padding: 6px 8px;
}

.sector-details.very-long-title h3 {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0;
}

.sector-details.very-long-title {
    padding: 4px 6px;
}

/* Companies section styling */
.companies-section {
    background-color: #eeae16;
    margin: 0;
    padding: 8px 15px;
    position: relative;
    border-radius: 0 0 16px 16px;
    overflow: visible; /* Changed from hidden to visible to allow tooltips to overflow */
    margin-top: auto; /* Push to bottom of flex container */
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
}

.companies-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/dithers/dither_1.jpg');
    background-size: cover;
    background-repeat: repeat;
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

/* Add foil animation overlay */
.companies-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/foil-animation.gif');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
    mix-blend-mode: overlay;
    z-index: 2;
    pointer-events: none;
}

.companies-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    flex: 1;
    min-width: 60%;
}


.companies-title {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    font-family: 'Inter', sans-serif;
    margin-bottom: 2px;
    position: relative;
    z-index: 2;
    line-height: 1;
}

@media (min-width: 768px) {
    .companies-title {
        font-size: 12px;
    }
}

.company-item {
    padding-left: 0;
    position: relative;
    line-height: 1;
}


.companies-section .company-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    font-size: 12px;
    transition: color 0.2s ease;
    border: 0;
    position: relative;
    display: inline-block;
    cursor: pointer;
    line-height: 1;
}

@media (min-width: 768px) {
    .companies-section .company-link {
        border-bottom: 1px solid var(--primary-color);
    }
    .companies-section .company-link:hover {
        color: var(--secondary-color);
        border-bottom: 1px solid var(--secondary-color);
    }
    .company-link:hover {
        z-index: 3;
    }
}   

/* Company tooltip styles - for all screen sizes */
.company-tooltip {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateY(-50%);
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 6px 12px 6px 26px;
    font-size: 11px;
    z-index: 200;
    margin-left: 14px;
    width: 200px; /* Limit tooltip width */
    white-space: normal;
    font-weight: 500;
    text-decoration: underline; /* Underline to indicate clickable */
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none; /* Prevent clicks when hidden */
    line-height: 1.5;
}

.company-tooltip::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-image: url('../assets/icons/link.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Ensure tooltip is visible and clickable when active */
.company-link.tooltip-active .company-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable interactions when visible */
}

/* Desktop styles for company links */
@media (min-width: 768px) {
    .companies-section .company-link {
        border-bottom: 1px solid var(--primary-color);
    }
    .companies-section .company-link:hover {
        color: var(--secondary-color);
        border-bottom: 1px solid var(--secondary-color);
        z-index: 3;
    }
    .company-tooltip {
        width: 230px;
        text-decoration: none;
    }
    /* Show tooltip on hover for desktop */
    .company-link:hover .company-tooltip {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .company-tooltip a {
        text-decoration: none;
    }
}

.sector-package {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    z-index: 10;
    overflow: visible;
    pointer-events: none; /* Allow clicks to pass through to the sector-item */
    transform-origin: center center;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.sector-package img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
}

/* Sectors hint styles */
.sectors-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    width: 100%;
}

.sectors-hint span {
    background: var(--accent-color-90);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--primary-color);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: auto;
}

.sectors-hint:not(.hidden) span {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .sectors-hint {
        bottom: 30px;
    }
    
    .sectors-hint span {
        padding: 10px 25px;
        font-size: 16px;
    }
}

/* Responsive grid settings */

