:root {
    --primary-color: #2196f3;
    --primary-rgb: 33, 150, 243;
    --text-primary: #1a1a1a;
    --text-secondary: #5f6368;
    --background-light: #f8f9fa;
    --primary-dark: #1557b0;  /* Add this line - darker shade of primary blue */
    --error-color: #dc3545;
    --error-bg: rgba(220, 53, 69, 0.1);
    --border-color: #dee2e6;
    /* Shared HIW layout vars */
    --stage-top: 88px;
    --stage-height: 65vh;
}

/* Base styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(to bottom, #ffffff, var(--background-light));
    min-height: 100vh;
    padding-top: 88px;
}

/* Force white background on marketing pages */
html.marketing, body.marketing { background: #ffffff !important; }

/* Shared page container (used across marketing + HIW) */
.page {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
}

/* Compact variant for pages that sit directly under fixed nav */
.page.page--compact-top { padding-top: 12px; }

/* Hero section */
.hero {
    text-align: center;
    padding: 0; /* page handles outer spacing; avoid double top space */
    margin-top: 0;
    margin-bottom: 0.25rem;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 0; /* Remove default H1 top margin */
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    line-height: 1.2;
    color: var(--primary-color); /* Ensure headline hex blue globally */
}

/* Ensure hero text scroll-offset is consistent with fixed nav */
.hero h1,
.hero p {
    scroll-margin-top: 96px;
}

/* HIW scrollytelling grid (safe globally) */
.scrolly { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .scrolly { grid-template-columns: 1fr; } }

/* HIW story section spacing and headings */
.story { position: relative; padding-top: 12px; padding-left: 56px; }
.story-step { min-height: var(--stage-height); display: flex; flex-direction: column; justify-content: flex-start; padding: 16px 16px 12px 12px; margin-bottom: 32px; }
.story-step:first-child { padding-top: 0; }
.story-step h2 { margin: 0 0 10px 0; font-size: 24px; display: flex; align-items: center; gap: 12px; }
.story-step h2.step-heading { display: grid; grid-template-columns: 30px 1fr; align-items: start; column-gap: 12px; }
.step-heading .step-index { flex: initial; width: 30px; height: 30px; justify-self: start; }
.step-heading .step-title { display: block; min-width: 0; word-break: break-word; }
.step-heading { row-gap: 4px; }
.story-step .step-index { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-color); color: #fff; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 30px; }
.story-step.limitation { background: #fffaf0; border: 1px solid #f59e0b; min-height: auto; padding: 12px 12px; margin-bottom: 16px; }
.story-step.limitation h3 { margin: 0 0 4px 0; font-size: 16px; color: #92400e; }
.story-step .content { font-size: 16px; }

/* HIW stage viewport */
.stage { position: sticky; top: calc(var(--stage-top) + 8px); height: var(--stage-height); margin-top: 12px; }
.stage-viewport { position: relative; width: 100%; height: 100%; perspective: 1000px; }

/* HIW media/card presentation */
.card { background: transparent; border: none; border-radius: 12px; padding: 0; box-shadow: none; position: absolute; inset: 0; display: grid; place-items: start center; grid-template-rows: 1fr; gap: 12px; opacity: 0; transform: translate3d(160px, 26px, 0) scale(.92) rotateX(3deg); filter: blur(6px); will-change: transform, opacity, filter; transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .6s ease, filter .6s ease; }
.card.active { opacity: 1; transform: translate3d(0,0,0) scale(1) rotateX(0deg); filter: blur(0); }
.media { position: relative; width: min(44vw, 880px, 90%); aspect-ratio: 16/9; border: 1px solid var(--primary-color); border-radius: 10px; background: #ffffff; display: grid; place-items: start center; overflow: hidden; }
.media .placeholder { font-size: 14px; color: var(--text-secondary); }
.media .filename { margin-top: 6px; color: var(--text-secondary); font-size: 12px; }

/* HIW utility */
.material-symbols-outlined { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }
.sentinel { height: 1px; }
.option-badge { display: inline-flex; background: #e8f2ff; color: var(--primary-dark); border: 1px solid #cde3ff; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; margin: 0; }
.option-note { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.or-divider { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; color: var(--text-secondary); margin: 8px 0 0 0; }
.step-title-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.page-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the left within this container */
    text-align: left;
}

.main-title-brand {
    font-size: 1em; /* Inherits from h1, so 2.2rem */
    color: var(--primary-color);
    font-weight: 700; /* Explicitly set, though h1 has it */
    line-height: 1.1;
}

.sub-title-edition {
    font-size: 0.55em; /* Smaller, relative to h1 font-size */
    color: var(--text-primary); /* Black */
    font-weight: 500;
    margin-top: -0.2em; /* Pull it up a bit */
    /* margin-left: 0.5em; /* Slight offset */ /* Let's see how it looks first without offset */
    line-height: 1;
}

.page-heading-icon {
    font-size: 1.1em;  /* Increased from 0.9em */
    color: var(--primary-color); /* Use theme color */
    animation: shimmerIcon 2.5s infinite ease-in-out;
}

@keyframes shimmerIcon {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem; /* Consistent padding */
    display: flex;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo .brand-icon {
    font-size: 28px;
    color: var(--primary-color);
}

.nav-logo .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nav-logo .brand-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo .brand-edition {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8rem;
    margin-top: -2px;
}

.nav-toggle {
    display: none; /* Hide checkbox */
}

.nav-toggle-label {
    display: none; /* Hide label (hamburger) by default */
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background-color: var(--text-primary);
    height: 3px;
    width: 25px;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease-in-out;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
}

.nav-toggle-label span::before {
    top: -8px;
}

.nav-toggle-label span::after {
    top: 8px;
}

.nav-links-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1; /* Allow this container to grow */
    justify-content: center; /* Center its content (the nav-center div) */
}

.nav-center {
    display: flex;
    gap: 1rem;
    align-items: center; /* Vertically align items to their center */
}

.nav-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap; /* Prevent wrapping */
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}
.nav-link.active { font-weight: 700; }

.nav-delimiter { color: var(--border-color); margin: 0 0.25rem; font-weight: 300; }

.nav-button {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.nav-button:hover {
    background: #1976d2;
}

/* File upload section */
.upload-section {
    width: 100%;
    max-width: 1000px;
    margin: 10px auto 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
    text-align: center;
    scroll-margin-top: 2rem;
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    /*margin-bottom: 1rem;*/
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: #f5f5f5;
}

/* Unified dragover state handled in upload-panel.css */

.text-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Hamburger Button */
/* Removed unused .hamburger-btn */

/* Mobile Navigation Menu */
@media (max-width: 992px) { 
    .nav-content {
        flex-wrap: wrap; /* Allow wrapping */
    }

    .nav-toggle-label {
        display: block; /* Show hamburger */
    }

    .nav-links-container {
        display: none; /* Hide links by default */
        flex-direction: column;
        width: 100%;
        background-color: white;
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        align-items: flex-start;
        max-height: calc(100vh - 60px); /* Limit height and enable scroll if needed */
        overflow-y: auto;
    }

    .nav-center, .nav-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0; /* Remove horizontal gap */
    }

    .nav-link, .nav-button {
        padding: 0.75rem 0; /* Vertical padding */
        display: block;
        width: 100%;
        text-align: left;
        border-top: 1px solid var(--border-color);
        min-height: 44px;
    }

    .nav-right .nav-link, .nav-right .nav-button {
        margin-top: 0.5rem; /* Add space before Sign In/Up */
    }

    .nav-button {
        width: auto; /* Let it size naturally */
        margin-top: 1rem;
        padding: 0.6rem 1.2rem;
    }

    .nav-delimiter {
        display: none; /* Hide delimiters */
    }

    /* Show menu when checkbox is checked */
    .nav-toggle:checked ~ .nav-links-container {
        display: flex;
    }

    /* Hamburger animation when checked */
    .nav-toggle:checked ~ .nav-toggle-label span {
        background-color: transparent; /* Hide middle line */
    }

    .nav-toggle:checked ~ .nav-toggle-label span::before {
        transform: rotate(45deg);
        top: 0;
    }

    .nav-toggle:checked ~ .nav-toggle-label span::after {
        transform: rotate(-45deg);
        top: 0;
    }
}

/* Remove conflicting mobile styles from previous attempts */
@media (max-width: 768px) {
    /* Clear any specific styles added before for mobile nav */
    .main-nav {
        padding: initial;
    }
    .nav-content {
        flex-direction: initial;
        align-items: initial;
        flex-wrap: nowrap; /* Revert wrap */
    }
    .nav-left:after {
        content: none; /* Ensure pseudo-element is gone */
        display: none;
    }
    .hamburger-btn {
        display: none; /* Ensure button is gone */
    }
    .main-nav.expanded .nav-center,
    .main-nav.expanded .nav-right {
        display: initial; /* Revert expansion logic */
    }
}

/* Ensure hamburger menu works properly */
/* Removed unused .navbar-toggler */

/* Handle collapsed state properly */
/* Removed unused .navbar-collapse */

@media (min-width: 769px) {
    .navbar-collapse.collapse {
        display: block;
    }
    
    .navbar-toggler {
        display: none;
    }
}

/* Styles for non-main-nav .nav-center (e.g., bottom of signin/signup) */
body > .nav-center {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Explicitly style links within the bottom nav if needed, but base .nav-link should apply */
body > .nav-center .nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

body > .nav-center .nav-link:hover {
    text-decoration: underline;
}

/* Add progress indicator styles */
.progress-container {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.loading-icon {
    animation: spin 2s linear infinite;
    color: var(--primary-color);
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

#progressStatus {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Dialog styles */
/* Removed global dialog sizing to avoid cross-page conflicts; scope per-dialog instead */

.text-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.text-preview h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.text-preview pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Results Table Styles */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.results-table th { font-weight: 600; color: var(--text-primary); }

.results-table td:nth-child(1) { /* Dimension column */
    width: 15%;
    font-weight: 500;
}

.results-table td:nth-child(2) { /* Score column */
    width: 10%;
    text-align: center;
}

.results-table td:nth-child(3) { /* Analysis column */
    width: 35%;
}

.results-table td:nth-child(4) { /* Recommendations column */
    width: 40%;
    font-style: italic;
    color: #666;
    white-space: pre-line; /* Preserve bullet points formatting */
}

.score-cell {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #f0f0f0;
}

.job-comparison {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.personal-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.personal-info-item {
    display: flex;
    flex-direction: column;
}

.personal-info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.personal-info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.selected-file {
    margin: 0.5rem 0;
    font-weight: 500;
    color: var(--primary-color);
    word-break: break-word;
    max-width: 100%;
    padding: 0 1rem;
}

/* Add pulsating arrow styles */
.pulse-arrow {
    display: none;
}

/* Update analyze button styles */
#analyzeButton {
    position: relative;
    transition: background-color 0.3s ease !important;
    scroll-margin-top: 1rem;
    
    margin-top: 2rem;
    min-width: 200px;
}

#analyzeButton:disabled {
    background-color: #ccc !important;
    cursor: not-allowed;
}

#analyzeButton:not(:disabled) {
    background-color: var(--primary-color) !important;
}

#analyzeButton:not(:disabled):hover {
    background-color: #1976d2 !important;
}

/* Progress Dialog Styles */
#uploadProgress {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
}

/* Progress Overlay Styles */
.progress-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 500px;
    height: 100px;
    text-align: center;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Ensure overlay inner layout is styled without JS-injected <style> */
.progress-overlay .progress-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    align-items: stretch;
    box-sizing: border-box;
    margin: 0 auto;
}
.progress-overlay .progress-message {
    justify-content: flex-start;
    margin-bottom: 0.5rem;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}
.progress-overlay #status-text {
    text-align: left;
    line-height: 1.5;
}
.progress-overlay .progress-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
    text-align: left;
    padding: 0 1rem;
    box-sizing: border-box;
    line-height: 1.5;
    min-height: 1.2em;
}
.progress-overlay .mdc-linear-progress {
    width: 100%;
    margin-bottom: 1.5rem;
    position: relative;
    left: 0;
    right: 0;
}
.progress-overlay .mdc-linear-progress:not(.mdc-linear-progress--indeterminate) .mdc-linear-progress__primary-bar,
.progress-overlay .mdc-linear-progress:not(.mdc-linear-progress--indeterminate) .mdc-linear-progress__secondary-bar {
    animation: none !important;
}
.progress-overlay .mdc-linear-progress__primary-bar > .mdc-linear-progress__bar-inner {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform-origin: left center !important;
}
.progress-overlay .mdc-linear-progress__buffer,
.progress-overlay .mdc-linear-progress__secondary-bar > .mdc-linear-progress__bar-inner {
    background-color: rgba(33, 150, 243, 0.2) !important;
}

.progress-messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.progress-message {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: var(--text-primary);
    opacity: 1;
    padding: 0.5rem 0;
}

/* Base icon styles without animation */
.progress-message .material-icons {
    font-size: 40px;
    color: var(--primary-color);
    flex-shrink: 0;
    opacity: 1;
}

/* Add animation only during processing */
.processing-active .progress-message .material-icons {
    animation: pulse-opacity 2s infinite ease-in-out;
}

.progress-message #status-text {
    font-size: 18px;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    flex-grow: 1;
    text-align: left;
}

/* Style for the OK button that appears at the end */
.progress-overlay .progress-dismiss {  
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: rgb(253, 251, 251);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 36px;
    line-height: 1;
}

.progress-dismiss:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress Dismiss Button */
.progress-dismiss.mdc-button--raised {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background-color: var(--primary-color);
}

.progress-dismiss.mdc-button--raised:hover {
    background-color: var(--primary-dark) !important;
}

.progress-dismiss.mdc-button--raised:active {
    background-color: var(--primary-dark) !important;
}

/* Opacity pulse animation */
@keyframes pulse-opacity {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.progress-message .material-icons.loading {
    animation: pulse-opacity 2s infinite ease-in-out;
}

/* Removed legacy commented progress styles */
/* Progress overlay blur effect */
.processing-active .main-nav,
.processing-active .hero,
.processing-active .main-content > *:not(#uploadProgress),
.processing-active .upload-section > *:not(#uploadProgress) {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

/* Ensure progress bar is visible during processing */
body.processing-active #uploadProgress {
    display: block;
}

/* Additional: ensure overlay sits above all UI, including fixed nav */
#uploadProgress { z-index: 2000; }
.progress-overlay { z-index: 2100; }

/* Blur step headers and section headers during processing to match other elements */
.processing-active .step-header,
.processing-active .section-header-with-button {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

/* Extend blur to profile selector and tab UI while processing */
.processing-active #profile-selector,
.processing-active #profile-selector-container,
.processing-active .profile-grid-container,
.processing-active .tab-container,
.processing-active .tab-strip,
.processing-active .stack-info,
.processing-active .section-divider {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

/* Add styles for the download button */
.mdc-dialog__actions {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.mdc-dialog__button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mdc-dialog__button .material-icons {
    font-size: 20px;
}

/* Style primary action button */
.mdc-dialog__button[data-mdc-dialog-action="download"] {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.mdc-dialog__button[data-mdc-dialog-action="download"]:hover {
    background-color: #1976d2 !important;
}

/* Add spinning animation for active icons 
@keyframes activeIconPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes activeIconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
*/
/* Update progress message styles */
.progress-message.active .material-icons {
    opacity: 1;
    color: var(--primary-color);
    animation: activeIconPulse 2s infinite;
}
/* 
/* Specific animations for different steps 
#extractingText.active .material-icons {
    animation: activeIconPulse 2s infinite;
}

#submittingAI.active .material-icons {
    animation: activeIconSpin 2s linear infinite;
}

#processingResults.active .material-icons {
    animation: activeIconPulse 1.5s infinite;
}

#aggregatingResults.active .material-icons {
    animation: activeIconSpin 3s linear infinite;
}

#retrievingResults.active .material-icons {
    animation: activeIconPulse 1s infinite;
} */

/* Add completed checkmark animation
@keyframes checkmarkDrop {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
} */

/* .progress-message.completed .material-icons {
    color: #4CAF50;
    opacity: 1;
    animation: checkmarkDrop 0.3s ease forwards;
} */

/* Tab styles */
.upload-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
}

.tab-button {
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    position: relative;
    top: 2px;
    margin-right: -1px;
}

.tab-button:hover {
    background: #fafafa;
    color: var(--primary-color);
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    border-bottom: 2px solid white;
    font-weight: 500;
    z-index: 1;
}

/* Job description input styles */
.job-description-input {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-1);
}

.input-toggle {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.input-radio {
    position: absolute;
    opacity: 0;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgb(84,150,242);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.input-radio:checked + .radio-custom {
    border-color: rgb(84,150,242);
}

.input-radio:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-text {
    font-size: 14px;
    color: #333;
}

/* Remove the old toggle button styles */
.toggle-button {
    display: none;
}

.job-description-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

/* Update results table for recommendations */
.results-table th:last-child,
.results-table td:last-child {
    width: 33%;
    padding: 1rem;
}

/* Tab content styles */
.tab-content {
    background: white;
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-1);
}

.pdf-viewer-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pdf-viewer-container iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Adjust dialog for PDF viewing */
.mdc-dialog.pdf-view .mdc-dialog__surface {
    max-width: 90vw;
    width: 90vw;
    height: 80vh;
}

.mdc-dialog.pdf-view .mdc-dialog__content {
    height: calc(100% - 120px);
    padding: 20px;
}

/* Style for secondary dialog actions */
.mdc-dialog__actions .mdc-button[data-mdc-dialog-action="close"] {
    color: rgba(0, 0, 0, 0.6);  /* Material Design standard text for secondary actions */
}

.report-options {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Commenting out MDC Checkbox specific styles from common.css for diagnostics */
/*
.checkbox-option input[type="checkbox"] {
    margin-right: 8px;
}

.checkbox-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
*/

/* Commenting out MDC Checkbox specific styles from common.css for diagnostics */
/*
.mdc-checkbox__native-control:checked ~ .mdc-checkbox__background,
.mdc-checkbox__native-control:indeterminate ~ .mdc-checkbox__background {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.mdc-checkbox__native-control:enabled:checked ~ .mdc-checkbox__background,
.mdc-checkbox__native-control:enabled:indeterminate ~ .mdc-checkbox__background {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.mdc-checkbox__ripple::before,
.mdc-checkbox__ripple::after {
    background-color: var(--primary-color);
}

.mdc-checkbox:hover .mdc-checkbox__native-control:not(:checked) ~ .mdc-checkbox__background {
    border-color: var(--primary-color);
}
*/

.generated-reports {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.csv-download-info {
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csv-download-info p {
    margin: 0;
    color: rgba(0, 0, 0, 0.87);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-color);
}

/* Make the selector more specific */
/* Upload icon styling is centralized in upload-panel.css */

/* Error Panel Styles */
.error-panel {
    display: none;  /* Start hidden */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px 32px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* Only show when visible class is added */
.error-panel.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.error-panel .material-icons {
    color: var(--primary-color);
    font-size: 32px;
    flex-shrink: 0;
}

.error-panel #errorMessage {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
}

.error-panel #errorMessage ul {
    margin: 0;
    padding-left: 20px;
}

.error-panel #errorMessage li {
    margin-bottom: 8px;
}

.error-panel #errorMessage li:last-child {
    margin-bottom: 0;
}

/* Error States */
.error-dismiss {
    margin-top: 16px;
    min-width: 64px;
}

/* Tab Button States */
.tab-button--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Error styling in progress overlay */
.progress-message.error {
    color: var(--error-color, #dc3545);
    background-color: var(--error-bg, rgba(220, 53, 69, 0.1));
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.progress-message.error .material-icons {
    color: var(--error-color, #dc3545);
}

.progress-dismiss {
    margin-top: 16px;
    min-width: 120px;
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Layout containers */
.content-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 8px;
    box-sizing: border-box;
}

/* Step headers */
.step-header {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    text-align: left;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Specifically add more margin to the Step 2 header */
.step-header:nth-of-type(2) {
    margin-top: 3rem;
}

.section-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto 1rem;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.section-header-with-button .step-header {
    width: auto;
    margin: 0;
    padding: 0;
}

.create-profile-button {
    margin-left: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    padding: 0 1.5rem;
    height: 36px;
    line-height: 36px;
}

/* Space between profile panel and Step 2 */
.step-header:nth-of-type(2) {
    margin-top: 4rem;
}

.profile-grid-container {
    width: 100%;
    max-width: 1000px;
    margin: 0.5rem auto 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

#profile-selector {
    display: flex;
    gap: 2rem;
}

.profile-grid {
    flex: 1;
    min-width: 0;
}

.dimensions-box {
    flex: 1;
    min-width: 0;
}

/* Tab layout */
.tab-strip,
.tab-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Drop zone sizing handled in upload-panel.css */

.profile-grid-container {
    margin-bottom: 3rem;
}

/* Profile panel container */
.profile-grid-container {
    width: 100%;
    max-width: 1000px;
    margin: 0.5rem auto 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
    display: flex;
    gap: 2rem;
}

/* Profile grid (left side) */
.profile-grid {
    flex: 1;
    min-width: 0;
}

/* Dimensions box (right side) */
.dimensions-box {
    flex: 1;
    min-width: 0;
}

/* Keep other styles the same */
.step-header {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    text-align: left;
}

.step-header + .profile-grid-container {
    margin-top: 0.5rem;
}

.step-header + .upload-section {
    margin-top: 2rem;
}

/* Single container for profile selector */
#profile-selector {
    display: flex;
    gap: 2rem;
}

.profile-grid {
    flex: 1;
    min-width: 0;
}

.dimensions-box {
    flex: 1;
    min-width: 0;
}

/* Section headers inside profile selector */
.profiles-header,
.dimensions-header {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
}

/* Keep other styles the same */
.profile-grid-container {
    display: flex;
    gap: 2rem;
    width: 100%;
}

.profile-grid {
    flex: 1;
    min-width: 0;
}

.dimensions-box {
    flex: 1;
    min-width: 0;
}

/* More specific selector to override inline styles */
.upload-section[class*="upload-section"] {
    width: 100%;
    max-width: 1000px;
    margin: 10px auto 0 !important;  /* Added !important to override inline style */
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

.disclaimer-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.disclaimer-content > h1:first-child {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 600;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.disclaimer-text {
    overflow-y: auto;
    padding: 0 1rem;
    margin: 0;
    max-height: calc(90vh - 200px);
}

.disclaimer-text h1,
.disclaimer-text h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
}

.disclaimer-text p {
    margin: 0.75rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.disclaimer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

#disclaimerCancel {
    color: var(--primary-color);
}

#disclaimerAgree {
    background-color: var(--primary-color);
    color: white;
    padding: 0 24px;
}

#disclaimerAgree:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.disclaimer-open {
    overflow: hidden;
}

/* MDC Checkbox Styles - Simplified AND SCOPED */
.mdc-checkbox { /* This rule is fine, it targets the checkbox wrapper */
    position: relative;
    width: 10px;  
    height: 10px; 
    margin: 0;
    padding: 0;
}

/* Make this rule HIGHLY specific to MDC Checkbox's native control */
.mdc-checkbox .mdc-checkbox__native-control { /* ADDED .mdc-checkbox PREDECESSOR */
    position: absolute;
    width: 10px;  
    height: 10px; 
    margin: 0;
    padding: 0;
    opacity: 1; /* This makes the native checkbox visible - intended for your custom simple checkbox */
    cursor: pointer;
    z-index: 1;
}

/* Make these rules HIGHLY specific to MDC Checkbox's parts */
.mdc-checkbox .mdc-checkbox__background,
.mdc-checkbox .mdc-checkbox__checkmark,
.mdc-checkbox .mdc-checkbox__mixedmark,
.mdc-checkbox .mdc-checkbox__ripple {
    display: none; /* This hides MDC's styled parts - intended for your custom simple checkbox */
}

.mdc-form-field > label { /* This rule seems fine as is if it's general form field label styling */
    font-size: 14px;  
    line-height: 14px; 
    margin: 0;
    padding: 0;
}

/* Style checkboxes with primary color - SCOPED */
.mdc-checkbox .mdc-checkbox__native-control:checked ~ .mdc-checkbox__background, /* Note: original selector might need .mdc-checkbox before __background too if direct child */
.mdc-checkbox .mdc-checkbox__native-control:indeterminate ~ .mdc-checkbox__background,
.mdc-checkbox .mdc-checkbox__native-control[data-indeterminate="true"] ~ .mdc-checkbox__background {
    border-color: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
}

/* Style checkbox ripple effect - SCOPED */
.mdc-checkbox .mdc-checkbox__ripple::before,
.mdc-checkbox .mdc-checkbox__ripple::after {
    background-color: var(--primary-color) !important;
}

.mdc-checkbox:hover .mdc-checkbox__native-control:not(:checked) ~ .mdc-checkbox__background { /* Scope this too */
    border-color: var(--primary-color) !important;
}

/* Keep report options in rsp-enterprise.css */
.stack-info {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0.25rem;
    box-sizing: border-box;
}

.stack-stat {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.stack-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stack-stat .material-icons {
    color: var(--primary-color);
    font-size: 1.75rem;
}

.stack-stat h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.0rem; /* Reduced headline size */
    font-weight: 600;
    color: var(--text-primary);
}

.stack-stat p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem; /* Reduced body text size */
    line-height: 1.5;
}

@media (max-width: 768px) {
    .stack-info {
        grid-template-columns: 1fr;
        padding: 0.25rem;
        gap: 0.75rem;
    }
    
    .stack-stat {
        padding: 0.75rem;
    }
}

/* Section Divider */
.section-divider {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    margin: 0;
}

/* General MDC Button Overrides */
.mdc-button--raised {
    background-color: var(--primary-color) !important;
    /* Ensure text is readable */
    color: white !important; 
}

.mdc-button--raised:hover {
    background-color: var(--primary-dark) !important; 
}

/* Footer Styles */
footer {
    background-color: #f8f9fa;
    padding: 2rem 1rem; /* Increased padding */
    margin-top: 3rem; /* Increased top margin */
    text-align: center;
    border-top: 1px solid #e0e0e0; /* Keep top border */
    color: var(--text-secondary); /* Use secondary text color */
    font-size: 0.9rem; /* Slightly smaller font */
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 1rem; /* Increased spacing between links */
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-dark); /* Use darker blue on hover */
    text-decoration: underline;
}

/* --- Results Section Styling (rsp-personal.html) --- */
#results-container {
    max-width: 1000px; /* Match width of sections above */
    margin: 3rem auto 0; /* Top margin and auto horizontal centering */
    padding: 0 1rem; /* Add some horizontal padding */
    box-sizing: border-box;
}

.results-section {
    background-color: #fff; /* Optional: background for the section */
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 1rem;
    width: 100%; /* Ensure section takes full width within container */
    box-sizing: border-box;
}

.pdf-results-container {
    width: 100%;
}

.pdf-viewer-wrapper {
    position: relative; /* Needed for overlay positioning */
    width: 100%;
    height: 75vh; /* Set a viewport-relative height */
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#pdfViewer.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* Styling for the blur overlay */
.results-blur-overlay { 
    position: absolute;
}

/* --- Specific adjustments for upload/results on single/multiple pages --- */

/* Single Upload Drop Zone */
/* Upload drop zone borders live in upload-panel.css */

/* Keep existing footer styles */
/* Removed duplicate footer override */

/* --- Edit Profiles Page Specific --- */
#archiveSelectedProfileButton {
    display: none !important; /* Hide the archive button */
}

/* Styles for the Regulatory Compliance card */
#compliance-card.stack-stat--compliance {
    position: relative; /* allow absolute-positioned badge inside */
}

#compliance-card.stack-stat--compliance .material-icons { /* Shield icon */
    margin-right: 0; /* Override default gap if needed, or let gap apply */
}

#compliance-card.stack-stat--compliance > div {
    padding-right: 70px; /* enough for 60px badge + gap, more room for headline */
}

#compliance-card.stack-stat--compliance h4 {
    white-space: nowrap; /* keep headline on one line */
}

#compliance-card.stack-stat--compliance .compliance-badge { /* Image */
    position: absolute;
    top: 1rem;      /* align with heading */
    right: 1rem;    /* sit at right edge inside card padding */
    width: 60px !important;
    height: 60px !important;
    object-fit: contain;
    border-radius: 4px;
}

#compliance-card.stack-stat--compliance .compliance-text { /* Paragraph */
    margin-top: 0;
    overflow: hidden; /* KEY for making paragraph wrap around float */
}

/* Style for the new User Notes field */
#userNotesField {
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-radius: 4px; /* Match MDC's border radius */
}

.section-header-with-button h3 {
    margin-bottom: 0;
}

/* Override MDC Text Field Focus Color */
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
    color: var(--primary-color) !important;
}

.mdc-text-field--focused .mdc-notched-outline__leading,
.mdc-text-field--focused .mdc-notched-outline__notch,
.mdc-text-field--focused .mdc-notched-outline__trailing {
    border-color: var(--primary-color) !important;
}

