@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;900&display=swap');

:root {
    /* Teal/Cyan Accessibility Theme */
    --primary-teal: #14b8a6;
    --primary-cyan: #0891b2;
    --secondary-emerald: #10b981;
    --accent-sky: #0ea5e9;

    --critical-red: #ef4444;
    --warning-amber: #f59e0b;
    --info-blue: #3b82f6;
    --success-green: #22c55e;

    --text-dark: #0f172a;
    --text-gray: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --bg-white: #ffffff;
    --bg-gray-50: #f8fafc;
    --bg-gray-100: #f1f5f9;
    --bg-teal-50: #f0fdfa;

    --border-gray: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);

    --radius-base: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: 0.25s ease;
}

/* High Contrast Mode */
body.high-contrast {
    --text-dark: #000000;
    --text-gray: #1a1a1a;
    --bg-white: #ffffff;
    --primary-teal: #0d9488;
    --border-gray: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    background: var(--bg-gray-50);
    line-height: 1.6;
}

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

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 3px solid var(--primary-teal);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-teal);
}

.accessibility-toggle {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-gray);
    background: var(--bg-white);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-gray);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Prevent shrinking on mobile */
}

.accessibility-toggle:hover {
    background: var(--primary-teal);
    color: white;
    border-color: var(--primary-teal);
}

/* Wizard Container */
.wizard-container {
    padding: 40px 0 60px;
}

/* Wizard Steps */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    /* Keep above line */
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-gray-100);
    border: 3px solid var(--border-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all var(--transition);
}

.step.active .step-number {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
    color: white;
}

.step.completed .step-number {
    background: var(--success-green);
    border-color: var(--success-green);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--primary-teal);
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--border-gray);
    min-width: 40px;
    /* Reduced min width for mobile */
    margin: 0 8px;
    position: relative;
    top: -20px;
}

/* Wizard Panels */
.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Section */
.upload-section {
    max-width: 700px;
    margin: 0 auto;
}

.upload-header {
    text-align: center;
    margin-bottom: 40px;
}

.upload-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.upload-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.drop-zone {
    background: var(--bg-white);
    border: 3px dashed var(--primary-teal);
    border-radius: var(--radius-xl);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
    background: var(--bg-teal-50);
    border-color: var(--primary-cyan);
}

.drop-icon {
    color: var(--primary-teal);
    margin-bottom: 20px;
}

.drop-zone h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.file-types {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 16px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-cyan) 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-base);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Center content on mobile */
    gap: 8px;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary.btn-large {
    padding: 18px 48px;
    font-size: 1.1rem;
    width: 100%;
    /* Better for mobile */
    max-width: 350px;
}

.btn-outline {
    background: transparent;
    color: var(--primary-teal);
    border: 2px solid var(--primary-teal);
    padding: 14px 32px;
    border-radius: var(--radius-base);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

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

.btn-text {
    background: none;
    border: none;
    color: var(--primary-teal);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* File Preview Card */
.file-preview {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

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

.preview-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-teal-50);
    border-radius: var(--radius-base);
    border: 2px solid var(--primary-teal);
    margin-bottom: 24px;
}

.file-icon-large {
    color: var(--primary-teal);
    flex-shrink: 0;
}

.file-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-all;
    /* Prevent overflow on long names */
}

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

.separator {
    margin: 0 8px;
}

/* Scanning Section */
.scanning-section {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.scan-animation {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 32px;
}

.pulse-circle {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--primary-teal);
    opacity: 0.3;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.scan-icon {
    position: relative;
    z-index: 1;
    color: var(--primary-teal);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.scanning-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.scan-status {
    color: var(--text-gray);
    margin-bottom: 32px;
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-gray-100);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 32px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal) 0%, var(--primary-cyan) 100%);
    width: 0%;
    transition: width 0.5s ease;
}

/* Scan Checklist */
.scan-checklist {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-base);
    border: 2px solid var(--border-gray);
}

.check-item.completed {
    border-color: var(--success-green);
}

.check-icon {
    font-size: 1.5rem;
}

.check-item.completed .check-icon::before {
    content: '✅';
}

/* Report Section */
.report-section {
    max-width: 900px;
    margin: 0 auto;
}

.score-card {
    display: flex;
    gap: 40px;
    align-items: center;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
}

.score-circle-container {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--bg-gray-100);
    stroke-width: 12;
}

.score-progress {
    fill: none;
    stroke: var(--primary-teal);
    stroke-width: 12;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s ease;
    stroke-linecap: round;
}

.score-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-teal);
    line-height: 1;
}

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

.score-info {
    flex: 1;
}

.score-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-info p {
    color: var(--text-gray);
    margin-bottom: 16px;
}

.level-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.level-badge.excellent {
    background: #dcfce7;
    color: #166534;
}

.level-badge.good {
    background: #dbeafe;
    color: #1e40af;
}

.level-badge.needs-work {
    background: #fef3c7;
    color: #92400e;
}

/* Issues Summary Grid */
.issues-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid;
}

.summary-card.critical {
    border-color: var(--critical-red);
}

.summary-card.warning {
    border-color: var(--warning-amber);
}

.summary-card.info {
    border-color: var(--info-blue);
}

.summary-card.success {
    border-color: var(--success-green);
}

.summary-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.summary-count {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Accordion for Issues */
.issues-detailed {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.issues-detailed h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.accordion-item {
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-base);
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background: var(--bg-gray-50);
    transition: background var(--transition);
}

.accordion-header:hover {
    background: var(--bg-gray-100);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.severity-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: var(--critical-red);
    color: white;
}

.severity-badge.warning {
    background: var(--warning-amber);
    color: white;
}

.accordion-icon {
    transition: transform var(--transition);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border-gray);
}

.accordion-item.active .accordion-content {
    display: block;
}

/* Solution Sections */
.issue-details {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-gray-100);
}

.issue-details p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.solution-section {
    background: var(--bg-teal-50);
    padding: 24px;
    border-radius: var(--radius-base);
    border-left: 4px solid var(--primary-teal);
}

.solution-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-teal);
    margin-bottom: 16px;
}

.solution-steps {
    margin-bottom: 20px;
    padding-left: 24px;
}

.solution-steps li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-gray);
}

.solution-tools {
    background: var(--bg-white);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.solution-tools strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.solution-tools ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.solution-tools li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.solution-tools li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-teal);
    font-weight: bold;
}

.solution-example {
    background: var(--bg-white);
    padding: 16px;
    border-radius: 6px;
}

.solution-example strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.solution-example p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-gray);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}


/* Report Actions */
.report-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Info Tabs */
.info-section {
    padding: 60px 0;
    background: var(--bg-white);
}

.info-section h2 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.info-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border-gray);
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-teal);
    border-bottom-color: var(--primary-teal);
}

.tab-content {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

.tab-content ul {
    margin-top: 16px;
    padding-left: 24px;
}

.tab-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

/* =========================================
   MEDIA QUERIES (Mobile & Tablet Support)
   ========================================= */

/* Tablet & Smaller Laptops */
@media (max-width: 992px) {
    .issues-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Devices (Landscape & Portrait) */
@media (max-width: 768px) {

    /* Header */
    .logo h1 {
        font-size: 1.2rem;
    }

    /* Wizard Steps - Compress */
    .wizard-steps {
        margin-bottom: 30px;
    }

    .step-line {
        min-width: 20px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Upload Section */
    .drop-zone {
        padding: 40px 20px;
    }

    .upload-header h2 {
        font-size: 1.6rem;
    }

    /* Score Card - Stack vertically */
    .score-card {
        flex-direction: column;
        text-align: center;
        padding: 30px;
        gap: 20px;
    }

    .score-info {
        width: 100%;
    }

    /* Action Buttons */
    .report-actions {
        flex-direction: column;
        width: 100%;
    }

    .report-actions button {
        width: 100%;
    }
}

/* Very Small Mobile Screens */
@media (max-width: 480px) {

    /* Logo adjustments */
    .logo h1 {
        font-size: 1rem;
        /* Hide text on extremely small screens if needed, 
           but usually flex-wrap is better */
    }

    /* Wizard Steps - Minimalist */
    .step-label {
        font-size: 0.75rem;
    }

    .step-line {
        margin: 0 4px;
    }

    /* Summary Cards - Single Column */
    .issues-summary {
        grid-template-columns: 1fr;
    }

    /* File Preview - Stack */
    .file-card {
        flex-direction: column;
        text-align: center;
    }

    /* Accordion Title */
    .accordion-title {
        font-size: 0.9rem;
    }

    /* Scanning Section */
    .scan-animation {
        width: 120px;
        height: 120px;
    }

    .pulse-circle {
        width: 120px;
        height: 120px;
    }

    .scan-icon {
        width: 60px;
        height: 60px;
        margin-top: 30px;
        /* Vertically align icon */
    }

    .issues-detailed {
        padding: 20px;
    }
}