/* Resource Design Hierarchy Colours */
:root {
    --cherry: #7B0B1B;      /* Section headers, Critical warnings, Key actions */
    --teal: #2A9D8F;        /* Explanatory text, Diagrams, Neurodiversity elements */
    --gold: #E9C46A;        /* Solution boxes, Progress trackers, Positive reinforcement */
    --canvas: #F8F5F0;      /* Worksheet backgrounds, Printable resource bases */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Neural Network Background */
.neural-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--cherry) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, var(--teal) 2px, transparent 2px);
    background-size: 50px 50px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 0;
    background: linear-gradient(135deg, var(--cherry), #5a0814);
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.logo-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

/* Brain Progress Indicator */
.progress-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid #e9ecef;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.brain-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.brain-progress svg {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Brain paths */
.brain-path {
    transition: opacity 0.8s ease, fill 0.5s ease;
    opacity: 0.3;
}

.brain-path.active {
    opacity: 1;
    fill: #2A9D8F;
    filter: drop-shadow(0 0 8px #2A9D8F);
    animation: brainPathGlow 2s ease-in-out infinite alternate;
}

.brain-path.active:nth-child(even) {
    fill: #E9C46A;
    filter: drop-shadow(0 0 8px #E9C46A);
}

@keyframes brainPathGlow {
    0% {
        filter: drop-shadow(0 0 4px currentColor);
    }
    100% {
        filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 0 16px currentColor);
    }
}

/* Completion state */
.brain-progress.completed .brain-path {
    opacity: 1;
    fill: #E9C46A;
    filter: drop-shadow(0 0 8px #E9C46A);
    animation: completionGlow 2s ease-in-out infinite alternate;
}

@keyframes completionGlow {
    0% {
        opacity: 0.8;
        filter: drop-shadow(0 0 4px rgba(233, 196, 106, 0.6));
    }
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 12px rgba(233, 196, 106, 0.8)) drop-shadow(0 0 16px rgba(233, 196, 106, 0.4));
    }
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: #666;
    position: relative;
    z-index: 3;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Question Container */
.question-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.welcome-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 30px;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.welcome-content > p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
}

.info-box, .instructions-box {
    background: var(--canvas);
    border-left: 5px solid var(--teal);
    padding: 25px;
    margin: 25px 0;
    text-align: left;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.info-box h3, .instructions-box h3 {
    color: var(--cherry);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box ul, .instructions-box ol {
    list-style-position: inside;
    margin-top: 15px;
    color: #333;
}

.info-box li, .instructions-box li {
    margin: 10px 0;
    line-height: 1.6;
}

.form-group {
    margin: 25px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px rgba(123, 11, 27, 0.1);
}

.form-group input::placeholder {
    color: #6c757d;
}

/* Question Screen */
.question-content {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.question-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cherry);
}

.barrier-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: var(--teal);
}

.barrier-ef { background: #e74c3c; }
.barrier-ss { background: #3498db; }
.barrier-sc { background: #9b59b6; }
.barrier-cc { background: #f39c12; }
.barrier-mc { background: #e67e22; }
.barrier-cg { background: #1abc9c; }
.barrier-ns { background: #95a5a6; }

.question-content h3 {
    font-size: 1.4rem;
    margin-bottom: 30px;
    color: #333;
    line-height: 1.5;
}

.diagram-container {
    margin: 25px 0;
    text-align: center;
    background: var(--canvas);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.diagram-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.answer-section {
    margin: 25px 0;
}

.answer-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

#answerInput {
    width: 100%;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

#answerInput:focus {
    outline: none;
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px rgba(123, 11, 27, 0.1);
}

.confidence-section {
    margin: 25px 0;
}

.confidence-section label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.confidence-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.conf-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.conf-btn:hover {
    border-color: var(--teal);
    background: var(--canvas);
    transform: translateY(-1px);
}

.conf-btn.active {
    background: var(--cherry);
    color: white;
    border-color: var(--cherry);
    box-shadow: 0 2px 8px rgba(123, 11, 27, 0.2);
}

.question-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 150px;
    justify-content: center;
}

.btn-primary {
    background: var(--cherry);
    color: white;
    box-shadow: 0 2px 8px rgba(123, 11, 27, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 11, 27, 0.3);
    background: #5a0814;
}

.btn-secondary {
    background: white;
    color: var(--cherry);
    border: 2px solid var(--cherry);
}

.btn-secondary:hover {
    background: var(--cherry);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 11, 27, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Certificate-Style Report Screen */
.certificate-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.certificate-border {
    background: white;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.certificate-content {
    background: white;
    border-radius: 16px;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.certificate-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cherry), var(--teal));
}

/* Certificate Header */
.certificate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #f0f0f0;
    position: relative;
}

.certificate-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--cherry), var(--teal));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(123, 11, 27, 0.3);
    overflow: hidden;
}

.certificate-logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.certificate-title {
    text-align: center;
    flex: 1;
    margin: 0 30px;
}

.certificate-title h1 {
    font-size: 3rem;
    color: #333;
    margin-bottom: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.certificate-subtitle {
    font-size: 1.2rem;
    color: var(--cherry);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.certificate-seal {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--gold), #f4d03f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 2rem;
    box-shadow: 0 10px 20px rgba(233, 196, 106, 0.3);
}

/* Certificate Body */
.certificate-body {
    margin-bottom: 40px;
}

.certificate-intro {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--canvas);
    border-radius: 10px;
    border-left: 5px solid var(--teal);
}

.certificate-intro p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

/* Results Summary */
.results-summary {
    margin-bottom: 40px;
}

.results-summary h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--cherry);
    padding-bottom: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(123, 11, 27, 0.08);
    border-color: var(--cherry);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--cherry), var(--teal));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 15px;
    box-shadow: 0 4px 12px rgba(123, 11, 27, 0.2);
}

.stat-box h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cherry);
    margin: 10px 0;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
}

/* Barrier Breakdown */
.barrier-breakdown {
    margin: 40px 0;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.barrier-breakdown h2 {
    font-size: 1.6rem;
    color: var(--cherry);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.barrier-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.barrier-stat {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    border-left: 4px solid var(--teal);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.barrier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.barrier-code {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--cherry);
}

.barrier-name {
    color: #666;
    font-size: 1rem;
}

.barrier-progress {
    margin: 15px 0;
}

.progress-bar-mini {
    background: #e9ecef;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill-mini {
    background: linear-gradient(90deg, var(--cherry), var(--teal));
    height: 100%;
    transition: width 0.3s;
    border-radius: 10px;
}

.barrier-details {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Next Steps */
.next-steps {
    background: var(--canvas);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    border-left: 5px solid var(--teal);
}

.next-steps h2 {
    color: var(--cherry);
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-weight: 600;
}

.next-steps p {
    margin: 10px 0;
    line-height: 1.6;
    color: #333;
}

/* Certificate Actions */
.certificate-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo-image {
        width: 50px;
        height: 50px;
    }
    
    .welcome-logo {
        width: 80px;
        height: 80px;
    }
    
    .certificate-logo-image {
        width: 50px;
        height: 50px;
    }
    
    .question-container {
        padding: 25px;
    }
    
    .welcome-content {
        padding: 30px 20px;
    }
    
    .certificate-content {
        padding: 30px 20px;
    }
    
    .certificate-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .certificate-title {
        margin: 0;
    }
    
    .certificate-title h1 {
        font-size: 2rem;
    }
    
    .question-nav {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .confidence-buttons {
        flex-direction: column;
    }
    
    .conf-btn {
        width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-container > div {
    animation: fadeIn 0.5s ease;
}

/* Hide neural network on results screen */
.results-content .neural-network {
    display: none;
}
