:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --danger-color: #ef4444;
    --danger-bg: #fef2f2;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 
   Improved Background Image:
   We use a pseudo-element to place the 'sixRow' image in a fixed, offset position.
   This keeps it visible but unobtrusive, sitting behind the main content card.
*/
body::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 300px;
    background-image: url('../../images/sixRow.png');
    /* Adjusted path for being inside css/ folder */
    background-repeat: no-repeat;
    background-position: top right;
    background-size: contain;
    opacity: 0.15;
    /* Subtle watermark effect */
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    /* Ensure it sits above any body backgrounds */
    z-index: 10;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 40px;
    background-image: none !important;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    margin-top: 0;
    padding: 0;
    /* Override global padding */
}

header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0;
    padding: 0;
}

/* Navigation */
nav {
    margin-top: 20px;
    width: 100%;
    /* Override fixed width from desktop.css */
}

nav>ul {
    justify-content: center;
    /* Center the nav items */
    gap: 20px;
}

nav>ul>li {
    border-left: none;
    /* Remove old borders */
    padding: 0;
}

nav>ul>li>a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

nav>ul>li>a:hover {
    color: var(--primary-color);
}

/* Card Component */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 40px;
    /* Enhanced padding */
    margin-bottom: 30px;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    color: var(--text-main);
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-danger {
    background-color: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-bg);
}

/* Question Page Specifics */
.q {
    margin-top: 30px;
}

.q p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 25px;
}

.scoreBoxs {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    /* Align boxes to start or center? Start usually better for form flow */
    flex-wrap: wrap;
}

.box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.box:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.box:active {
    background-color: var(--primary-color);
    color: white;
}

/* End Page Specifics */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.score-card {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.score-card .role {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.score-card .value {
    display: block;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.score-card.top-score {
    border: 2px solid var(--primary-color);
    background-color: #e0e7ff;
    /* light indigo */
    transform: scale(1.05);
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}


.top-roles-intro {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--text-muted);
}

.role-detail {
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 4px solid var(--primary-color);
}

.role-detail h4 {
    font-size: 1.25rem;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.role-detail p {
    margin: 0;
    color: var(--text-muted);
}

#noMain {
    display: none;
    text-align: center;
    padding: 40px;
}

#main {
    /* Main container is visible by default */
}

/* Footer improvements */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    /* Reset fixed positioning from desktop.css */
    bottom: auto;
    background: transparent;
    width: auto;
}

.footer-actions {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    /* var(--border-color) */
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease-out;
    border-radius: 999px;
}

.contact-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Specific Page Elements (extracted from inline styles) */

/* Index Page */
.start-action {
    text-align: center;
    margin-top: 30px;
}

/* Questions Page */
.question-intro {
    font-size: 1.1rem;
}

#qNo {
    font-weight: 800;
    color: var(--primary-color);
}

.scale-helper {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 15px;
}

/* End Page */
.no-score-msg {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Improved Score Layout */
.ww-scores-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.ww-score-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ww-score-card.highlight {
    border: 2px solid var(--primary-color);
    background-color: #eef2ff;
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
}

/* Badge for the highest score */
.ww-score-card.highlight::before {
    content: "Highest";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.ww-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.ww-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
    min-height: 40px;
    /* Align text across cards */
}

.ww-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 15px 0;
}

/* Section Dividers */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

/* Meaning Grid */
.meaning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.meaning-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border-left: 3px solid transparent;
}

.meaning-item.ww1 {
    border-left-color: #3b82f6;
}

/* Blue */
.meaning-item.ww2 {
    border-left-color: #eab308;
}

/* Yellow */
.meaning-item.ww3 {
    border-left-color: #ef4444;
}

/* Red */

.meaning-item h5 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--text-main);
}

.intro-text {
    margin-bottom: 20px;
}

.fine-print {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 20px;
    text-align: center;
}

.score-val {
    font-weight: 800;
    color: var(--primary-color);
}

.score-desc {
    color: var(--text-muted);
}

.scoring-guide {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.scoring-guide h4 {
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 0;
}

.scoring-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
}

.separator {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.context-note {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 20px;
}


/* Responsive Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }

    .card {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header h2 {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
        /* Full width buttons on mobile */
        box-sizing: border-box;
    }

    .scoreBoxs {
        justify-content: center;
        /* Center boxes on small screens */
    }
}

/* Modal Dialog */
dialog {
    border: none;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    color: var(--text-main);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

dialog h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--text-main);
    border-bottom: none;
    margin-bottom: 10px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

/* More Page Specifics */

/* =========================================
   Quinto-Quanto Test Interface Styles
   ========================================= */

#countDownSection {
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    margin: 40px auto;
    max-width: 500px;
    background: white;
}

#countDownSection p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
}

#showCountDown {
    font-size: 4rem !important;
    color: var(--text-main) !important;
}

#mainTest {
    display: none;
    /* Hidden until countdown finishes */
    max-width: 600px;
    margin: 0 auto;
}

/* Target Area (Image or Word) */
.oneRow {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    min-height: 300px;
    align-items: center;
}

#showTarget {
    position: relative;
    width: 100%;
    max-width: 450px;
}

#showTarget img {
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: block;
    border: 1px solid var(--border-color);
}

#showTarget h3 {
    background-color: #f59e0b;
    /* Amber-500 */
    color: white;
    padding: 40px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Interaction Area */
.flexRow {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: stretch;
}

.grid3 {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.grid3:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.grid3 img {
    width: 60px;
    height: auto;
    margin-bottom: 10px;
}

/* Like Me */
#likeMe {
    background-color: #ecfdf5;
    /* Emerald-50 */
    border-color: #10b981;
    /* Emerald-500 */
}

#likeMe h3 {
    color: #065f46;
    /* Emerald-800 */
    font-size: 0.9rem;
    margin: 0;
    border: none;
    padding: 0;
}

/* Not Like Me */
#notLikeMe {
    background-color: #fef2f2;
    /* Red-50 */
    border-color: #ef4444;
    /* Red-500 */
}

#notLikeMe h3 {
    color: #991b1b;
    /* Red-800 */
    font-size: 0.9rem;
    margin: 0;
    border: none;
    padding: 0;
}

/* Bin It */
#binIt {
    background-color: #f1f5f9;
    /* Slate-100 */
    border-color: #64748b;
    /* Slate-500 */
    flex: 0.6;
    /* Smaller interaction area for bin */
}

#binIt img {
    width: 50px;
}

/* =========================================
   End Page & Charts
   ========================================= */

.results-columns {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

@media (min-width: 768px) {
    .results-columns {
        flex-direction: row;
    }

    .col-scores {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .col-chart {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .col-chart {
        order: -1;
        /* Chart first on desktop? Or stick to design */
    }
}

.score-block {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
}

.score-block h3 {
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    border: none;
    padding: 0;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
}

.score-block span {
    font-weight: 800;
    color: var(--primary-color);
}

/* Ocean Colors */
.score-block.ocean-o {
    border-left-color: #f59e0b;
}

/* Orange/Openness->Practical? map later */
.score-block.ocean-c {
    border-left-color: #3b82f6;
}

/* Blue/Conscientiousness->Organised */
.score-block.ocean-e {
    border-left-color: #ec4899;
}

/* Pink/Extraversion->Spirit */
.score-block.ocean-a {
    border-left-color: #10b981;
}

/* Green/Agreeableness->Getting-along */
.score-block.ocean-n {
    border-left-color: #6366f1;
}

/* Indigo/Neuroticism->Experience */

#chart {
    margin: 0 auto;
}

.roles-heading-boxed {
    margin-bottom: 30px;
    text-align: center;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
}

.score-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-note {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}