/* Montserrat Variable Font */
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Montserrat Static Fonts (fallbacks for specific weights) */
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/static/Montserrat-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Orbitron Font */
@font-face {
    font-family: 'Orbitron';
    src: url('fonts/Orbitron-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Roboto Fonts */
@font-face {
    font-family: 'Roboto';
    src: url('fonts/Roboto-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('fonts/Roboto-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Montserrat', 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: black;
    color: white;
    line-height: 1.2;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header removed for full-bleed design */

main {
    flex-grow: 1;
    padding: 0;
    margin: 0;
    width: 100%;
}

.content-section {
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 30, 60, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    position: relative; 
    z-index: 1; 
    overflow: hidden;
}

/* Welcome Screen Styles - Full Bleed Design */
.welcome-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.welcome-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("Assets/Start/Startskjerm_BG.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.welcome-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100vh;
    color: white !important;
    text-shadow: none;
}

.welcome-content * {
    color: white !important;
}

.welcome-content h1 {
    color: #FFD700 !important;
}

.welcome-text h2 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: normal;
    color: white !important;
}

.welcome-text h1 {
    font-size: 4rem;
    margin: 0.5rem 0;
    font-weight: bold;
    color: #FFD700 !important;
    text-shadow: none;
    letter-spacing: 2px;
}

.welcome-text h3 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: normal;
    color: white !important;
}

/* Responsive design for mobile devices */
@media (max-width: 768px) {
    .welcome-text h2 {
        font-size: 1.8rem;
    }
    
    .welcome-text h1 {
        font-size: 2.8rem;
        letter-spacing: 1px;
    }
    
    .welcome-text h3 {
        font-size: 1.8rem;
    }
    
    .fish-button {
        width: 20vw;
        height: 12.5vw;
        max-width: 300px;
        max-height: 188px;
    }
    
    .welcome-description {
        width: 80vw;
    }
    
    .welcome-description p {
        font-size: 1.6rem !important;
    }
    
    .fish-button-container {
        margin: 3rem 0;
    }
    
    .moloen-logo img {
        height: 45px;
    }
    
    .moloen-logo {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .welcome-text h2 {
        font-size: 1.5rem;
    }
    
    .welcome-text h1 {
        font-size: 2.2rem;
        letter-spacing: 0.5px;
    }
    
    .welcome-text h3 {
        font-size: 1.5rem;
    }
    
    .fish-button {
        width: 18vw;
        height: 11.25vw;
        max-width: 250px;
        max-height: 156px;
    }
    
    .fish-button-container {
        margin: 2rem 0;
    }
    
    .moloen-logo img {
        height: 35px;
    }
    
    .moloen-logo {
        bottom: 1rem;
        right: 1rem;
    }
    
    /* Quiz screen responsive styles */
    #quiz-container .question-card h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .question-image {
        max-width: 300px;
        max-height: 200px;
        margin-bottom: 1.5rem;
    }
    
    .question-comment {
        font-size: 1rem;
        margin: -0.5rem 0 1.5rem 0;
    }
}

/* Additional tablet responsive styles for quiz */
@media (max-width: 768px) {
    #quiz-container .question-card h3 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .question-image {
        max-width: 350px;
        max-height: 250px;
        margin-bottom: 2rem;
    }
    
    .question-comment {
        font-size: 1.1rem;
        margin: -0.5rem 0 2rem 0;
    }
}

.fish-button-container {
    margin: 5rem 0;
}

.fish-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    display: block;
    width: 25vw;
    height: 15.6vw;
    max-width: 400px;
    max-height: 250px;
    background-image: url("Assets/Start/Startsjerm_TRYKK_START.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    outline: none;
    box-shadow: none;
    animation: fishPulse 3s ease-in-out infinite;
}

.fish-button:hover {
    transform: scale(1.05);
}

.fish-button:focus {
    outline: none;
    box-shadow: none;
}

/* Fish button text removed - only graphic remains */

.welcome-description {
    margin: 2rem 0;
    width: 60vw;
    max-width: 700px;
}

.welcome-description p {
    font-size: 1.5rem !important;
    margin: 0;
    color: white !important;
    text-shadow: none;
    line-height: 1.45;
    max-width: 100%;
}

/* Welcome buttons section removed */

.moloen-logo {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 3;
}

.moloen-logo img {
    height: 6vh;
    width: auto;
    opacity: 0.9;
    filter: none;
    animation: pulse 4s ease-in-out infinite;
}

.career-action-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    height: 29vh;
    width: 100%;
    color: #003142;
    font-family: 'Montserrat', 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2vh;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.career-action-btn img {
    height: 28vh;
    width: auto;
}

.se-filmen-text {
    color: #003142;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-top: 1vh;
}

.results-bottom-text {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    z-index: 10;
    text-shadow: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-bottom-text:hover {
    color: #F7D74D;
    transform: translateX(-50%) scale(1.05);
}

.results-start-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 4.5rem;
    height: 4.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1000;
    padding: 0;
}

.results-start-btn svg {
    width: 28px;
    height: 28px;
}

.results-start-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

@keyframes fishPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

/* Quiz Screen Styles */
.quiz-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.quiz-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.quiz-header {
    position: absolute;
    top: 1vh;
    left: 1vw;
    z-index: 4;
}

.quiz-logo {
    height: 8vh;
    width: auto;
}


.quiz-restart-btn {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    z-index: 4;
    background-color: #00496B;
    color: white;
    border: none;
    padding: 1.5vh;
    border-radius: 0 0 14px 14px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 73, 107, 0.3);
    width: 100%;
    margin-top: 2vh;
}

/* Results Screen Styles */
.results-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.results-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: black;
    z-index: 1;
    opacity: 0;
    transition: none;
}

.results-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    padding: 0;
    margin-top: 5vh;
}

/* Simpler hiding class for now if needed, but wrapper controls visibility */
.is-hidden-simple {
    display: none !important;
}

#welcome-container h2 {
    color: #003366;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* Removed conflicting welcome container p rule */

#quiz-container .question-card {
    background: #003142;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    max-width: 900px;
    width: 85%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: white;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
}

#quiz-container .question-card.question-card-visible {
    opacity: 1;
}

#quiz-container .question-card h3 {
    color: white !important;
    margin-top: 1vh;
    margin-bottom: 1vh;
    font-weight: 600;
    font-size: 2.2rem;
    text-shadow: none;
    background-color: transparent;
}

#results-container h2,
#debug-info-container h3,
#debug-info-container h4,
#db-stats-container h3, 
#db-stats-container h4 {
    color: #003366;
    margin-top: 0;
    margin-bottom: -1rem; /* Applied to db-stats h4 too */
    font-weight: 600;
}

.question-comment {
    font-size: 1rem;
    font-style: italic;
    color: #ccc !important;
    margin: -0.5rem 0 2rem 0;
    text-align: center;
    text-shadow: none;
}

#db-stats-container h4 {
    margin-top: 2rem;
}

#db-stats-container hr {
    margin-top: 2rem;
    margin-bottom: 0;
}

/* New Podium Styles */
#podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Align items to the bottom for podium effect */
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    min-height: 250px; /* Give some space for the podium */
    position: relative; /* For potential confetti positioning later */
}

.podium-place {
    display: flex;
    flex-direction: column; /* Keep column for badge above name area */
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    margin: 0 0.5rem;
    width: 31%; 
    border-radius: 8px 8px 0 0; 
    background-color: rgba(0, 77, 153, 0.2); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    will-change: opacity, transform;
}

.podium-place.visible { /* Class to trigger animation */
    opacity: 1;
    transform: translateY(0);
}

#podium-place-1 {
    order: 2; /* Center */
    height: 16.25vh; /* Tallest, responsive */
    background-color: rgba(255, 215, 0, 0.7); /* Gold-ish */
    z-index: 3;
}

#podium-place-2 {
    order: 1; /* Left */
    height: 15vh; /* Medium, responsive */
    background-color: rgba(192, 192, 192, 0.6); /* Silver-ish */
    z-index: 2;
}

#podium-place-3 {
    order: 3; /* Right */
    height: 13.75vh; /* Shortest, responsive */
    background-color: rgba(205, 127, 50, 0.6); /* Bronze-ish */
    z-index: 1;
}

.podium-rank-badge {
    font-size: 1.8rem; 
    font-weight: bold;
    color: #fff;
    background-color: rgba(0, 51, 102, 0.7); 
    border-radius: 50%;
    width: 2.8vh; 
    height: 2.8vh; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0; /* Prevent badge from shrinking */
}

#podium-place-1 .podium-rank-badge {
    background-color: #b8860b; /* Darker gold */
}
#podium-place-2 .podium-rank-badge {
    background-color: #808080; /* Darker silver */
}
#podium-place-3 .podium-rank-badge {
    background-color: #8B4513; /* Darker bronze */
}

.podium-profession-name {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1.1rem;
    font-weight: bold;
    color: #002244; 
    padding: 0.5rem 0.2rem;
    text-align: left;
    transform: rotate(180deg);
}

.podium-base {
    /* This div is mostly for visual structure if we want to add more complex base shapes later. */
    /* For now, the podium-place background and height define the steps. */
    /* We could add specific styling here if needed. */
    height: 20px; /* Example: give a bit of depth if not using background on place itself */
    width: 100%;
    /* background-color: inherit; */ /* Or a contrasting color */
}

/* Results heading */
#results-header {
    margin-bottom: -1rem;
    color: white !important;
    font-size: 2.9rem;
    text-align: center;
    text-shadow: none !important;
}

.results-subtext {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.9;
}

/* Career cards container */
#career-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4vh;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 4vh auto;
    height: 68vh;
    align-items: center;
    justify-items: center;
}

/* Career card styles */
.career-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1vh 3vw;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    height: 100%;
    width: 20vw;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.career-card:first-child {
    background: rgba(81, 205, 244, 0.9);
    border: 1px solid rgba(81, 205, 244, 0.7);
    grid-row: 1 / 3;
    grid-column: 1;
    backdrop-filter: blur(20px);
    grid-column: 1;
    grid-row: 1 / 3;
}

.career-card:nth-child(2) {
    background: rgba(0, 74, 106, 0.9);
    border: 1px solid rgba(0, 74, 106, 0.7);
    grid-row: 1;
    grid-column: 2;
    backdrop-filter: blur(20px);
}

.career-card:nth-child(3) {
    background: rgba(0, 46, 64, 0.9);
    border: 1px solid rgba(0, 46, 64, 0.7);
    grid-row: 2;
    grid-column: 2;
    backdrop-filter: blur(20px);
}

.career-number {
    font-family: 'Montserrat', 'Arial Black', Arial, sans-serif;
    font-size: 12rem;
    color: white;
    text-shadow: none;
    position: absolute;
    z-index: 10;
    letter-spacing: -4px;
    line-height: 0.7;
}

.career-card:first-child .career-number {
    font-weight: 900;
}

.career-card:nth-child(2) .career-number,
.career-card:nth-child(3) .career-number {
    font-weight: 700;
}

.career-card:first-child .career-number {
    color: #51CDF4;
    font-weight: 700;
    font-size: 28rem;
    left: -12rem;
    top: 4vh;
    transform: none;
}

.career-card:nth-child(2) .career-number,
.career-card:nth-child(3) .career-number {
    color: white;
    font-weight: 700;
    font-size: 16rem;
    right: -12rem;
    top: 50%;
    transform: translateY(-50%);
}


.career-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

.career-name {
    color: white;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: none;
    line-height: 1.2;
}

/* Subtitle under career name */
.career-subtitle {
    color: white;
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0.6vh 0 0.8vh 0;
    text-shadow: none;
    line-height: 1.35;
}

.career-card:first-child .career-name {
    color: #002E40;
    font-size: 2.5rem;
}

/* Match subtitle color with heading color on first (winner) card */
.career-card:first-child .career-subtitle {
    color: #002E40;
}

.career-icon {
    margin: 0.5vh 0;
    display: flex;
    align-items: center;
    gap: 0.5vw;
}

.career-icon img {
    height: 6vh;
    width: auto;
}

.career-action {
    color: white;
    font-size: 1rem;
    margin: 0;
    text-shadow: none;
    font-weight: 400;
}

.career-card:first-child .career-action {
    color: #003142;
}

/* Career action button inside career-info */
.career-action-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    height: 29vh;
    width: 100%;
    color: #003142;
    font-family: 'Montserrat', 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2vh;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Valgomat logo positioning */
.valgomat-logo {
    position: absolute;
    top: 1vh;
    left: 1vw;
    z-index: 4;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.valgomat-logo:hover {
    transform: scale(1.05);
}

.valgomat-logo img {
    height: 8vh;
    width: auto;
}


/* Footer removed for full-bleed design */

button {
    background-color: #005f99;
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.15s ease, box-shadow 0.2s ease;
    display: block;
    margin: 1.5rem auto 0 auto;
}

/* Hover effect removed */

button:active {
    transform: translateY(0px);
    box-shadow: 0 3px 8px rgba(0, 95, 153, 0.2);
}

.restart-btn {
    background-color: #6c757d;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
    margin-top: 1.5rem;
}

/* Restart button hover effect removed */

.secondary-action-btn {
    background-color: #6c757d; 
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
    margin-top: 0.75rem; 
}

/* Secondary action button hover effect removed */

#debug-info-container {
    background-color: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(206, 212, 218, 0.5);
    padding: 1.5rem;
    /* margin-top: 2.5rem; Will be controlled by wrapper or direct parent */
    border-radius: 8px;
}

/* #debug-info-container h3 is covered by the shared rule */

#debug-user-answers {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Montserrat', monospace;
    font-size: 0.9rem;
    max-height: none; 
    overflow-y: hidden;
    white-space: normal; 
    margin-bottom: 1rem; 
}

#debug-user-answers p {
    margin: 0.3em 0;
    word-break: break-word;
}

#debug-user-answers strong {
    font-weight: bold;
}

#debug-matrix-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    table-layout: fixed;
}

#debug-matrix-table-container th,
#debug-matrix-table-container td {
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: top;
    /* white-space: normal; */ /* Default is normal, but we might override for headers */
    overflow-wrap: break-word;
    word-break: break-word;
}

#debug-matrix-table-container th:first-child,
#debug-matrix-table-container td:first-child {
    width: 35%;
    max-width: 35%;
}

#debug-matrix-table-container th {
    background-color: #e9ecef;
    white-space: nowrap; /* Prevent headers from wrapping */
}

#debug-matrix-table-container th.question-header-cell {
    text-align: center;
}

#debug-matrix-table-container th.sum-header-cell {
    text-align: right;
}

#debug-matrix-table-container td.score-cell {
    text-align: center;
    font-weight: bold;
}

#debug-matrix-table-container td.total-score-cell {
    text-align: right;
    font-weight: bold;
}

#db-stats-container {
    background-color: rgba(240, 245, 250, 0.8);
    border: 1px solid rgba(180, 200, 220, 0.5);
    padding: 1.5rem;
    /* margin-top: 2.5rem; Will be controlled by wrapper or parent */
    border-radius: 8px;
}

/* #db-stats-container h3, h4 covered by shared rule */

#db-summary-stats p, 
#db-top-professions-stats ul, /* This ID might be old, check HTML, was db-profession-score-summary */
#db-profession-score-summary ul, /* Added for clarity */
#db-question-answer-frequency ul, /* Added for clarity */
#db-top-professions-stats li, /* This ID might be old */
#db-profession-score-summary li, /* Added for clarity */
#db-question-answer-frequency li {
    font-size: 0.9rem;
    color: #002244;
}

#db-summary-stats p {
    margin: 0.3em 0;
}

#db-profession-score-summary ul,
#db-question-answer-frequency ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.5em; /* Add some space above lists */
}

#db-profession-score-summary li, 
#db-question-answer-frequency li {
    padding: 0.2em 0;
}

/* Wrapper for all debug/stats sections for animation */
.debug-stats-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-20px);
    transition: max-height 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), 
                opacity 0.5s ease-in-out 0.1s, 
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: max-height, opacity, transform;
    margin-top: 1.5rem; 
}

.debug-stats-wrapper.is-visible-slide {
    opacity: 1;
    max-height: fit-content; /* Reverting to fit-content */
    transform: translateY(0);
}

#all-debug-stats-wrapper > #debug-info-container,
#all-debug-stats-wrapper > #db-stats-container {
    margin-top: 0; 
    margin-bottom: 1.5rem; 
}

#all-debug-stats-wrapper > #db-stats-container {
    margin-bottom: 0; 
}

/* Remove direct display:none from individual debug containers if previously controlled by JS showScreen */
/* #debug-info-container, #db-stats-container will now be controlled by the wrapper's visibility */

/* Confetti Styles */
.confetti-particle {
    position: absolute; /* Positioned relative to #podium-container or a full-screen overlay */
    width: 10px;
    height: 10px;
    background-color: #f00; /* Placeholder, will be varied by JS */
    opacity: 0;
    border-radius: 50%; /* Can be mixed with squares for variety */
    pointer-events: none; /* So they don't interfere with clicks */
}

/* New styles for icon-based options */
#quiz-container .options { /* This is the container for the options */
    display: flex;
    justify-content: center; /* Center the group of options */
    align-items: stretch; /* Make all items same height */
    margin-top: 1vh;
    margin-left: 0.5vw;
    margin-right: 0.5vw;
    gap: 0.5vw; /* Minimal gap between the options */
    width: calc(100% - 1vw);
    flex: 0 1 auto;
}

/* Fallback for browsers that don't support gap */
#quiz-container .options .icon-option:not(:last-child) {
    margin-right: 0.5vw;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align content to top */
    text-align: center;
    padding: 2.5vh 1.5vw;
    border: none; 
    border-radius: 8px;
    cursor: pointer;
    flex: 1 1 0; /* Each takes equal space, start from 0 */
    box-sizing: border-box; /* Ensure padding/border are included in width calc */
    min-width: 0; /* Allow flex items to shrink below content size */
    align-self: stretch; /* Make all buttons same height */
    background-color: #e3f2fd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
    
    opacity: 0; 
    transform: translateY(15px); 
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.3s ease-out, opacity 0.3s ease-out, box-shadow 0.2s ease;
    will-change: opacity, transform, border-color, background-color;
}

.icon-option:nth-child(1) {
    background-color: #48CBF3;
}

.icon-option:nth-child(2) {
    background-color: #F7D74D;
}

.icon-option.option-visible { /* Animation class */
    opacity: 1;
    transform: translateY(0);
}

/* Icon option hover effect removed */

.question-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.question-content {
    padding: 2vh 2vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 0 1 auto;
    overflow: visible;
    min-height: 0;
}

.question-image-container {
    width: 100%;
    height: 48.2vh;
    overflow: hidden;
    position: relative;
}

.icon-option.selected {
    background-color: #1976d2;
    border-color: #1976d2;
    box-shadow: 0 3px 6px rgba(25, 118, 210, 0.2);
}

.icon-option.selected .option-text,
.icon-option.selected .option-description {
    color: #ffffff;
}

.icon-option i { /* Font Awesome icon */
    display: none; /* Hide icons for now */
}

.icon-option .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align content to top */
    width: 100%;
    gap: 0.8vh;
    flex: 1; /* Take available space */
    padding-top: 0; /* Ensure consistent top alignment */
}

.icon-option .option-text { /* Text label */
    font-size: clamp(1rem, 2.5vw, 1.5rem); /* Responsive font size */
    line-height: 1.2;
    color: #003142;
    font-weight: 700;
    background-color: transparent;
    word-wrap: break-word;
    word-break: normal; /* Don't break words mid-word, only at natural break points */
    hyphens: auto; /* Allow hyphenation for better line breaks */
    max-width: 100%;
    overflow-wrap: break-word; /* Break long words only if necessary */
    white-space: normal;
    text-align: center;
    margin: 0;
    padding: 0;
    display: block;
    flex-shrink: 0; /* Prevent text from shrinking */
}

.icon-option .option-description { /* Description text */
    font-size: clamp(0.75rem, 1.8vw, 1rem);
    line-height: 1.4;
    color: rgba(0, 49, 66, 0.8);
    font-weight: 400;
    background-color: transparent;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: none;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: center;
    margin: 0;
    padding: 0;
    display: block;
    flex-shrink: 1; /* Allow description to take remaining space */
}

/* Question card responsive adjustments */
@media (max-width: 768px) {
    #quiz-container .question-card {
        max-width: 500px;
        padding: 1.5rem;
    }
    
    .question-image {
        max-width: 400px;
    }
    
    #quiz-container .question-card h3 {
        font-size: 1.6rem;
    }
    
    .icon-option .option-text {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .icon-option .option-description {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .icon-option {
        min-height: 16vh;
        padding: 2vh 1.2vw;
    }
}

@media (max-width: 480px) {
    #quiz-container .question-card {
        max-width: 350px;
        padding: 1rem;
    }
    
    .question-image {
        max-width: 300px;
    }
    
    #quiz-container .question-card h3 {
        font-size: 1.4rem;
    }
    
    .icon-option {
        padding: 3vh 1vw;
        height: 14vh;
    }
    
    .icon-option .option-text {
        font-size: 1.2rem;
        line-height: 1.4;
    }
}

/* --- Generic Statistics Table Styling --- */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem; /* Increased padding for better spacing */
    border: 1px solid rgba(0, 77, 153, 0.1);
    text-align: left;
    vertical-align: middle;
}

.stats-table thead th {
    background-color: rgba(229, 239, 248, 0.5);
    font-weight: 600;
}

.stats-table thead th:nth-child(n+2) {
    text-align: center;
}

/* New zebra-striping based on question groups, not individual rows */
.stats-table .qg-even {
    background-color: rgba(245, 248, 251, 0.7);
}

/* Specific alignment rules using classes for consistency */
.stats-table .col-profession-name,
.stats-table .col-question,
.stats-table .col-answer {
    text-align: left;
}

.stats-table .col-total-score,
.stats-table .col-times-won,
.stats-table .col-count,
.stats-table td:nth-child(3) { /* Fallback for the count column in the flattened view */
    text-align: center;
}

/* Special styling for the 'no answer' message cell */
.stats-table td[colspan="2"] {
    text-align: center;
    font-style: italic;
    color: #666;
}

/* --- Sorting Indicator Styling --- */
.sortable-header {
    cursor: pointer;
    position: relative;
}

.sortable-header::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    position: absolute;
    right: 0.25rem;
    top: calc(50% - 0.5em);
    opacity: 0.4;
}

.sortable-header.sorted-asc::after {
    content: '▲';
    opacity: 1;
}

.sortable-header.sorted-desc::after {
    content: '▼';
    opacity: 1;
}

/* Alle Yrker page styles */
.alle-yrker-page {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-image: url('Assets/Resultat/Valgomat_UI_Resultat_BG.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 2rem;
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: none;
    zoom: 1;
}

.alle-yrker-page.is-hidden-simple {
    display: none !important;
}

.alle-yrker-page .main-container {
    background: rgba(81, 205, 244, 0.9);
    border: 1px solid rgba(81, 205, 244, 0.7);
    border-radius: 16px;
    padding: 3rem;
    max-width: 1200px;
    width: 90%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.alle-yrker-header {
    text-align: center;
    margin-bottom: 3rem;
}

.alle-yrker-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    color: #002E40;
    text-shadow: none;
}

.professions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.profession-card {
    background: transparent;
    border: 2px solid #002E40;
    border-radius: 12px;
    padding: 1.2rem 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0.5rem;
    flex: 1 1 auto;
    min-width: fit-content;
    max-width: calc(25% - 1rem);
}

.profession-card:hover {
    background: rgba(0, 46, 64, 0.1);
    transform: translateY(-2px);
}

.profession-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #002E40;
    text-shadow: none;
}

.alle-yrker-page .back-button {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 4.5rem;
    height: 4.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1000;
    padding: 0;
}

.alle-yrker-page .back-button svg {
    width: 32px;
    height: 32px;
}

/* Hide back button when video is playing */
.video-overlay .back-button {
    display: none !important;
}

.alle-yrker-page .back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Moloen logo positioning on Alle Yrker page */
.alle-yrker-page .moloen-logo {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.alle-yrker-page .moloen-logo img {
    height: 6vh;
    width: auto;
    max-height: 60px;
}

/* Tablet-specific adjustments (iPad) - removed complex rules */

@media (max-width: 768px) {
    .alle-yrker-page {
        padding: 1rem;
    }
    
    .alle-yrker-page .main-container {
        padding: 2rem;
        width: 95%;
    }
    
    .alle-yrker-header h1 {
        font-size: 2.5rem;
    }
    
    .profession-card {
        margin: 0.3rem;
        padding: 1rem 1.5rem;
        font-size: 1.4rem;
    }

    .profession-card h3 {
        font-size: 1.2rem;
    }
}

/* Video Player Styles */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-overlay.is-hidden-simple {
    display: none !important;
}

.video-fade-black {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 1001;
    overflow: hidden;
}

.video-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.video-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.video-close-btn:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.95);
}

.video-close-btn:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-close-btn:focus:not(:active) {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-volume-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1002;
}

/* Fallback for browsers that don't support gap */
.video-volume-controls .volume-btn:not(:last-child) {
    margin-right: 1rem;
}

.volume-btn {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    line-height: 1;
    padding: 0;
}

.volume-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.volume-btn {
    transform: scale(1);
    background: rgba(0, 0, 0, 0.3);
}

.volume-btn:active {
    transform: scale(0.95) !important;
    background: rgba(0, 0, 0, 0.95) !important;
}

.volume-btn:not(:active) {
    transform: scale(1) !important;
    background: rgba(0, 0, 0, 0.3) !important;
}


.volume-btn:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.volume-btn:focus:not(:active) {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#volume-indicator {
    position: absolute;
    bottom: 6rem;
    right: 50%;
    transform: translateX(50%);
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.4rem;
    border-radius: 1rem;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

#volume-indicator:hover,
#volume-indicator:focus,
#volume-indicator:active {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.video-subtitle-controls {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1002;
}

/* Fallback for browsers that don't support gap */
.video-subtitle-controls .subtitle-btn:not(:last-child) {
    margin-right: 1rem;
}

.subtitle-btn {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    line-height: 1;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.flag-btn {
    position: relative;
    overflow: hidden;
}

/* Norwegian Flag */
.flag-nor {
    background-image: url("img/nor.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
}

/* British Flag (Union Jack) */
.flag-eng {
    background-image: url("img/eng.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
}

.subtitle-btn:hover:not(.flag-btn) {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.flag-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.flag-nor:hover {
    background-image: url("img/nor.png") !important;
}

.flag-eng:hover {
    background-image: url("img/eng.png") !important;
}

.subtitle-btn:active:not(.flag-btn) {
    transform: scale(0.95) !important;
    background: rgba(0, 0, 0, 0.95) !important;
}

.flag-btn:active {
    transform: scale(0.95) !important;
}

.flag-nor:active {
    background-image: url("img/nor.png") !important;
}

.flag-eng:active {
    background-image: url("img/eng.png") !important;
}

.subtitle-btn:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.subtitle-btn.active {
    border-width: 3px;
    border-color: rgba(100, 200, 255, 1);
    box-shadow: 0 0 0 2px rgba(100, 200, 255, 0.5), 0 4px 20px rgba(0, 100, 200, 0.5);
    transform: scale(1.05);
}

.flag-nor.active {
    background-image: url("img/nor.png") !important;
}

.flag-eng.active {
    background-image: url("img/eng.png") !important;
}

.subtitle-overlay {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    z-index: 1003;
    display: none;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.career-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Career card cursor pointer */
.career-card {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.career-card:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.career-info {
    animation: careerCardPulse 3s ease-in-out infinite;
}

@keyframes careerCardPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

/* Attract Mode Styles */
.attract-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.attract-mode-overlay.is-hidden-simple {
    display: none !important;
}

.attract-mode-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
