/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;700&family=Roboto:wght@300;400;700&family=Permanent+Marker&family=Architects+Daughter&family=Reenie+Beanie&display=swap');

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

:root {
    --wl-navy: #003366;
    --wl-navy-dark: #002244;
    --wl-gray: #6B7280;
    --wl-light-gray: #F3F4F6;
    --wl-pale-blue: #EFF6FF;
    --wl-border: #E5E7EB;
    --wl-text: #1F2937;
    --wl-text-light: #4B5563;
    --bg-primary: #ffffff;
    --bg-secondary: #F3F4F6;
}

[data-theme="dark"] {
    --wl-navy: #5BA3FF;
    --wl-navy-dark: #4A90E2;
    --wl-gray: #9CA3AF;
    --wl-light-gray: #2D2D2D;
    --wl-pale-blue: #1F2937;
    --wl-border: #4A4A4A;
    --wl-text: #F3F4F6;
    --wl-text-light: #D1D5DB;
    --bg-primary: #1A1A1A;
    --bg-secondary: #242424;
}

[data-theme="dark"] body {
    background-image: none;
    background: var(--bg-primary);
}

[data-theme="dark"] body::before {
    display: none;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--wl-text);
    background: var(--bg-primary);
    background-image: url('AdobeStock_559851645.jpeg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--wl-navy);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wl-navy);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--wl-navy);
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--wl-navy);
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
    color: var(--wl-text);
}

a {
    color: var(--wl-navy);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--wl-navy-dark);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
}

/* Header */
header {
    background: var(--wl-navy);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Hero Section */
.hero {
    background: var(--wl-navy);
    color: white;
    padding: 5rem 0;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero .subheadline {
    font-size: 1.375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 900px;
}

.hero p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin-bottom: 2rem;
}

/* Pattern Cards */
.pattern-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.pattern-card {
    border: 1px solid var(--wl-border);
    padding: 2rem;
    background: var(--bg-primary);
    transition: box-shadow 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.pattern-card:hover {
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
}

.badge {
    display: inline-block;
    font-size: 2rem;
    margin-bottom: 1rem;
    filter: grayscale(1);
    -webkit-filter: grayscale(1);
}

.badge-left {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.pattern-card-content {
    flex: 1;
}

.pattern-card h3 {
    margin-bottom: 1rem;
    margin-top: 0;
}

.pattern-card p {
    color: var(--wl-text);
    margin-bottom: 1rem;
}

.why-matters {
    font-size: 0.95rem;
    color: var(--wl-text-light);
    font-style: italic;
    border-left: 3px solid var(--wl-navy);
    padding-left: 1rem;
    margin-top: 1.5rem;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

button, .button {
    background: var(--wl-navy);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

button:hover, .button:hover {
    background: var(--wl-navy-dark);
    text-decoration: none;
}

button:disabled {
    background: var(--wl-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

button.secondary, .button.secondary {
    background: var(--bg-primary);
    color: var(--wl-navy);
    border: 2px solid var(--wl-navy);
}

button.secondary:hover, .button.secondary:hover {
    background: var(--wl-light-gray);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--wl-border);
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--wl-gray);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 1rem;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--wl-navy);
    background: none;
}

.tab.active {
    color: var(--wl-navy);
    border-bottom-color: var(--wl-navy);
}

/* Assignment Overview Panel */
.assignment-overview {
    background: var(--wl-light-gray);
    border-left: 4px solid var(--wl-navy);
    padding: 2rem;
    margin-bottom: 3rem;
}

.assignment-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.assignment-meta-item {
    display: flex;
    flex-direction: column;
}

.assignment-meta-label {
    font-weight: 700;
    color: var(--wl-navy);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.assignment-meta-value {
    color: var(--wl-text);
}

.overview-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.overview-section h4:first-of-type {
    margin-top: 0;
}

/* Stages Container */
.stages-container {
    background: rgba(0, 47, 108, 0.02);
    border: 2px solid rgba(0, 47, 108, 0.1);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stage-arrow {
    text-align: center;
    font-size: 2rem;
    color: var(--wl-navy);
    margin: 1rem 0;
    opacity: 0.6;
}

/* Accordion */
.accordion {
    border: 1px solid var(--wl-border);
    margin-bottom: 1.5rem;
}

.stages-container .accordion {
    margin-bottom: 0;
}

.accordion-header {
    background: var(--wl-light-gray);
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--wl-border);
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background: #E5E7EB;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stage-badge {
    background: var(--wl-navy);
    color: white;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.accordion-title h3 {
    margin: 0;
    font-size: 1.375rem;
}

.accordion-icon {
    font-size: 1.25rem;
    color: var(--wl-navy);
    transition: transform 0.3s;
}

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

.accordion-content {
    display: none;
}

.accordion-content.open {
    display: block;
}

.accordion-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.accordion-panel {
    padding: 2rem;
    border-right: 1px solid var(--wl-border);
}

.accordion-panel:last-child {
    border-right: none;
}

.panel-student {
    background: var(--bg-primary);
    padding: 2rem;
}

.panel-pedagogy {
    background: #FFFEF8;
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 47px,
            #E8E5D8 47px,
            #E8E5D8 48px
        );
    background-size: 100% 48px;
    padding: 2rem 2rem 2rem 3rem;
    position: relative;
}


.pedagogy-content {
    display: block;
    font-family: 'Architects Daughter', cursive;
    font-size: 1.25rem !important;
    line-height: 1.8;
    color: #2C3E50;
    font-weight: 400;
}

/* Reenie Beanie font option */
[data-handwriting="reenie"] .pedagogy-content {
    font-family: 'Reenie Beanie', cursive;
    font-size: 1.4rem !important;
    line-height: 1.3;
}

.pedagogy-content strong {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem !important;
    font-weight: 400;
    color: #C0392B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 1rem;
}

.pedagogy-content p {
    margin-bottom: 2rem;
    font-size: inherit !important;
}

.accordion-panel h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.accordion-panel h4:first-child {
    margin-top: 0;
}

.accordion-panel ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.accordion-panel li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.accordion-panel strong {
    color: var(--wl-navy);
    font-weight: 600;
}

/* Full Assignment Button */
.full-assignment-button {
    margin-top: 2rem;
    text-align: center;
}

/* Instructor Quotes */
.instructor-quote {
    position: relative;
    margin: 1rem 0 1.5rem 0;
    padding: 0.5rem 1rem;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.7;
}

.instructor-quote::before {
    content: '\201C';
    position: absolute;
    left: -0.5rem;
    top: -0.5rem;
    font-size: 4rem;
    line-height: 1;
    color: var(--wl-navy);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.instructor-quote::after {
    content: '\201D';
    position: absolute;
    right: -0.25rem;
    bottom: -2rem;
    font-size: 4rem;
    line-height: 1;
    color: var(--wl-navy);
    opacity: 0.3;
    font-family: Georgia, serif;
}

[data-theme="dark"] .instructor-quote::before,
[data-theme="dark"] .instructor-quote::after {
    color: var(--wl-navy);
    opacity: 0.4;
}

/* Form Elements */
.form-section {
    background: var(--wl-light-gray);
    border: 1px solid var(--wl-border);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-intro {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--wl-border);
}

.form-intro p {
    font-size: 1.0625rem;
    color: var(--wl-text-light);
}

.form-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--wl-navy);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.help-text {
    font-size: 0.9rem;
    color: var(--wl-text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--wl-border);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--wl-navy);
}

input.validation-error,
textarea.validation-error,
select.validation-error {
    border: 2px solid #DC2626;
    background: #FEF2F2;
}

[data-theme="dark"] input.validation-error,
[data-theme="dark"] textarea.validation-error,
[data-theme="dark"] select.validation-error {
    border: 2px solid #DC2626;
    background: #3A1F1F;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: auto;
    flex-shrink: 0;
}

.checkbox-item label {
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.radio-item input[type="radio"] {
    margin-top: 0.25rem;
    width: auto;
    flex-shrink: 0;
}

.radio-item label {
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--wl-border);
    z-index: -1;
}

.progress-step:last-child::after {
    display: none;
}

.progress-number {
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--wl-border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--wl-gray);
    transition: all 0.2s;
}

.progress-step.active .progress-number {
    background: var(--wl-navy);
    color: white;
    border-color: var(--wl-navy);
}

.progress-step.completed .progress-number {
    background: var(--wl-navy);
    color: white;
    border-color: var(--wl-navy);
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wl-gray);
    text-align: center;
}

.progress-step.active .progress-label {
    color: var(--wl-navy);
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--wl-border);
}

/* Output Section */
.output-section {
    background: var(--bg-primary);
    border: 1px solid var(--wl-border);
    padding: 2rem;
}

.output-tabs {
    display: flex;
    border-bottom: 2px solid var(--wl-border);
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.output-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--wl-gray);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.output-tab:hover {
    color: var(--wl-navy);
}

.output-tab.active {
    color: var(--wl-navy);
    border-bottom-color: var(--wl-navy);
}

.output-content {
    background: var(--wl-light-gray);
    padding: 2rem;
    border: 1px solid var(--wl-border);
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
}

.output-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* Resource Cards */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.resource-card {
    border: 1px solid var(--wl-border);
    padding: 2rem;
    background: var(--bg-primary);
    transition: box-shadow 0.3s;
    cursor: pointer;
}

.resource-card:hover {
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
}

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    filter: grayscale(1);
    -webkit-filter: grayscale(1);
}

.resource-card h3 {
    margin-bottom: 1rem;
}

.resource-preview {
    color: var(--wl-text-light);
    margin-bottom: 1rem;
}

.resource-content {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--wl-border);
}

.resource-content.visible {
    display: block;
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid #E5E7EB;
    padding: 24px 20px 30px;
    text-align: center;
    margin-top: 32px;
}

.footer-content {
    text-align: center;
    position: relative;
}

.footer-credit-wrapper {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #6B7280;
}

.footer-credit-link {
    color: #6B7280;
    text-decoration: none;
}

.footer-credit-link:hover {
    color: var(--wl-navy);
    text-decoration: underline;
}

.footer-copyright {
    color: #6B7280;
    font-size: 14px;
    margin: 15px 0;
    line-height: 1.6;
}

.footer-copyright a {
    color: #6B7280;
    text-decoration: none;
}

.footer-copyright a:hover {
    color: var(--wl-navy);
    text-decoration: underline;
}

.footer-feedback-link {
    font-weight: bold;
    font-style: italic;
}

.ai-statement-container {
    margin-top: 20px;
    margin-bottom: 8px;
    text-align: center;
}

.footer-statement {
    display: block;
    font-style: italic;
    color: var(--wl-navy);
    font-size: 13px;
    line-height: 1.6;
}

.footer-copy-btn {
    background: var(--wl-navy);
    color: white;
    border: 1px solid var(--wl-navy);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: block;
    margin: 8px auto 0;
}

.footer-copy-btn:hover {
    background: none;
    color: #6B7280;
    border-color: #E5E7EB;
}

.footer-copy-btn:active {
    transform: scale(0.98);
}

/* Responsive Design */
@media (max-width: 968px) {
    .pattern-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .accordion-panels {
        grid-template-columns: 1fr;
    }

    .accordion-panel {
        border-right: none;
        border-bottom: 1px solid var(--wl-border);
    }

    .accordion-panel:last-child {
        border-bottom: none;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    nav {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subheadline {
        font-size: 1.125rem;
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 3rem 0;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 0.875rem 1.25rem;
    }

    .button-group {
        flex-direction: column;
    }

    .progress-indicator {
        overflow-x: auto;
    }

    .progress-label {
        font-size: 0.75rem;
    }
}

/* Resource Content Formatting */
.resource-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wl-navy);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--wl-border);
    padding-bottom: 0.5rem;
}

.resource-content h3:first-child {
    margin-top: 0;
}

.resource-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wl-navy);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.resource-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.resource-content strong {
    font-weight: 600;
    color: var(--wl-navy);
}

.resource-content em {
    font-style: italic;
}

.resource-content hr {
    border: none;
    border-top: 1px solid var(--wl-border);
    margin: 2rem 0;
}

.resource-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.resource-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.resource-content blockquote {
    border-left: 4px solid var(--wl-navy);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--wl-text-light);
    font-style: italic;
}

.resource-content code {
    background: var(--wl-light-gray);
    padding: 0.2rem 0.4rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Theme Toggle and Utility Buttons */
.utility-buttons {
    position: fixed;
    top: 80px;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 90;
}

.utility-btn {
    background: var(--wl-navy);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.utility-btn:hover {
    background: var(--wl-navy-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.utility-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .utility-buttons {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        flex-direction: row;
    }

    .utility-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* Larger handwriting font on mobile for better readability */
    [data-handwriting="reenie"] .pedagogy-content {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }
}

/* Dark mode specific adjustments */
[data-theme="dark"] .pattern-card,
[data-theme="dark"] .case-card,
[data-theme="dark"] .resource-card,
[data-theme="dark"] .discipline-button,
[data-theme="dark"] .accordion-header,
[data-theme="dark"] .form-group,
[data-theme="dark"] .form-wizard {
    background: #2A2A2A;
    border-color: #444444;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-primary);
    color: var(--wl-text);
    border-color: var(--wl-border);
}

[data-theme="dark"] .pedagogy-panel {
    background: var(--bg-primary);
    border-color: var(--wl-border);
}

[data-theme="dark"] .output-display {
    background: var(--bg-primary);
    border-color: var(--wl-border);
}

[data-theme="dark"] .output-display pre {
    background: var(--bg-secondary);
    color: var(--wl-text);
}

/* Print Styles */
@media print {
    /* Hide unnecessary elements for clean print */
    .utility-buttons,
    header nav,
    footer,
    .stage-arrow,
    button,
    .tabs,
    .output-tabs,
    .output-actions {
        display: none !important;
    }

    /* Reset page styles */
    body {
        background: white !important;
        background-image: none !important;
        color: black !important;
        font-size: 11pt;
        line-height: 1.4;
        margin: 0;
        padding: 0;
    }

    body::before {
        display: none !important;
    }

    @page {
        margin: 0.75in;
        size: letter;
    }

    /* Compact header */
    header {
        position: static;
        background: white;
        color: #003366;
        border-bottom: 2px solid #003366;
        padding: 0.5rem 0;
        margin-bottom: 1rem;
    }

    header .logo img {
        max-height: 30px;
    }

    /* Minimal hero */
    .hero {
        background: white;
        color: #003366;
        padding: 1rem 0;
        margin-bottom: 1rem;
        border-bottom: 1px solid #ccc;
        page-break-after: avoid;
    }

    .hero h1 {
        font-size: 18pt;
        margin-bottom: 0.5rem;
        color: #003366;
    }

    .hero .subheadline,
    .hero p {
        font-size: 10pt;
        margin-bottom: 0.25rem;
        color: black;
    }

    /* Compact sections */
    section {
        padding: 0.5rem 0 !important;
        background: white !important;
    }

    .container,
    .container-wide {
        max-width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    h2 {
        font-size: 14pt;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        color: #003366;
        page-break-after: avoid;
    }

    h3 {
        font-size: 12pt;
        margin-top: 0.75rem;
        margin-bottom: 0.4rem;
        color: #003366;
        page-break-after: avoid;
    }

    h4 {
        font-size: 11pt;
        margin-top: 0.5rem;
        margin-bottom: 0.3rem;
        color: #003366;
        page-break-after: avoid;
    }

    p {
        margin-bottom: 0.4rem;
        text-align: justify;
    }

    /* Compact lists */
    ul, ol {
        margin: 0.3rem 0 0.5rem 1.5rem;
        padding: 0;
    }

    li {
        margin-bottom: 0.2rem;
    }

    /* Pattern cards - compact */
    .pattern-cards {
        display: block;
    }

    .pattern-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        background: white;
    }

    .pattern-card h3 {
        font-size: 11pt;
        margin: 0 0 0.3rem 0;
    }

    .badge-left {
        font-size: 14pt;
        margin-right: 0.5rem;
    }

    /* Accordion sections */
    .accordion-header {
        background: white !important;
        border: 1px solid #003366;
        padding: 0.3rem 0.5rem;
        margin-bottom: 0.3rem;
        page-break-after: avoid;
    }

    .accordion-content {
        display: block !important;
    }

    .accordion-panels {
        display: block;
        background: white;
    }

    .accordion-panel {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        background: white;
    }

    .panel-student,
    .panel-pedagogy {
        border-left: 3px solid #003366;
        background: white !important;
    }

    .pedagogy-content {
        font-family: "Times New Roman", serif !important;
        font-size: 10pt !important;
    }

    /* Compact instructor quotes */
    .instructor-quote {
        font-size: 10pt;
        margin: 0.3rem 0;
        padding: 0.3rem 0.5rem;
        border-left: 2px solid #003366;
    }

    .instructor-quote::before,
    .instructor-quote::after {
        display: none;
    }

    /* Hide large decorative elements */
    .assignment-overview {
        margin-bottom: 0.5rem;
    }

    /* Compact resource sections */
    .resource-item {
        page-break-inside: avoid;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        border: 1px solid #ddd;
    }
    
    .accordion-content,
    .resource-content {
        display: block !important;
        max-height: none !important;
    }
    
    .accordion-header::after {
        display: none;
    }
    
    button {
        display: none;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--wl-gray);
    }
}

/* Additional dark mode fixes */
[data-theme="dark"] .panel-student,
[data-theme="dark"] .accordion-content,
[data-theme="dark"] button.secondary,
[data-theme="dark"] .button.secondary {
    background: var(--bg-secondary);
    border-color: var(--wl-border);
}

[data-theme="dark"] .panel-pedagogy {
    background: #2A2520;
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 47px,
            #3A352D 47px,
            #3A352D 48px
        );
}


[data-theme="dark"] .pedagogy-content {
    color: #E8D7C3;
}

[data-theme="dark"] .pedagogy-content strong {
    color: #E74C3C;
    font-family: 'Permanent Marker', cursive;
    text-transform: uppercase;
    font-size: 1.5rem !important;
}

[data-theme="dark"] button.secondary,
[data-theme="dark"] .button.secondary {
    color: var(--wl-navy);
}

[data-theme="dark"]::before {
    display: none;
}

[data-theme="dark"] footer {
    background: #1F2937;
}

[data-theme="dark"] .footer-logo {
    display: none;
}

[data-theme="dark"] .footer-credit-wrapper {
    display: none;
}

[data-theme="dark"] .resource-icon {
    opacity: 0.9;
}

[data-theme="dark"] .progress-number {
    border-color: var(--wl-border);
    background: transparent;
    color: var(--wl-text);
}

[data-theme="dark"] .progress-label {
    color: var(--wl-text-light);
}

[data-theme="dark"] .progress-step::after {
    background: var(--wl-border);
}

[data-theme="dark"] .checkbox-group,
[data-theme="dark"] .radio-group {
    background: transparent;
}

/* Dark mode tab fixes */
[data-theme="dark"] .tab {
    color: var(--wl-text-light);
}

[data-theme="dark"] .tab.active {
    color: var(--wl-navy);
    border-bottom-color: var(--wl-navy);
    background: transparent;
}

[data-theme="dark"] .tab:hover {
    color: var(--wl-navy);
    background: none;
}

/* Hero link styling */
.hero a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    transition: color 0.2s;
}

.hero a:hover {
    color: white;
    text-decoration: underline;
}

/* Footer logo */
.footer-logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

@media (max-width: 768px) {
    .footer-logo {
        max-width: 180px;
    }
}

/* Form validation errors */
input.error,
select.error,
textarea.error {
    border-color: #DC2626;
    background-color: rgba(220, 38, 38, 0.05);
}

.error-message {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.checkbox-group.error,
.radio-group.error,
.checkbox-group.validation-error,
.radio-group.validation-error {
    border: 2px solid #DC2626;
    padding: 1rem;
    border-radius: 4px;
    background-color: rgba(220, 38, 38, 0.05);
}

[data-theme="dark"] input.error,
[data-theme="dark"] select.error,
[data-theme="dark"] textarea.error {
    border-color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .error-message {
    color: #F87171;
}

[data-theme="dark"] .checkbox-group.error,
[data-theme="dark"] .radio-group.error {
    border-color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* =========================================================================
   PRINT STYLES FOR DESIGNER OUTPUT
   ========================================================================= */

@media print {
    /* Only hide content when printing from designer (body has print-designer-only class) */
    body.print-designer-only > *:not(#root),
    body.print-designer-only header,
    body.print-designer-only footer,
    body.print-designer-only .hero,
    body.print-designer-only nav,
    body.print-designer-only .utility-buttons,
    body.print-designer-only .output-actions,
    body.print-designer-only .output-tabs,
    body.print-designer-only .progress-indicator,
    body.print-designer-only .form-navigation,
    body.print-designer-only .form-section,
    body.print-designer-only .form-intro,
    body.print-designer-only .form-group,
    body.print-designer-only button,
    body.print-designer-only input,
    body.print-designer-only textarea,
    body.print-designer-only select,
    body.print-designer-only .no-print,
    body.print-designer-only section:not(#designer),
    body.print-designer-only #designer > .container > *:not(.output-section) {
        display: none !important;
    }

    /* Show only the output section */
    .output-section {
        display: block !important;
    }

    /* Ensure body and container print cleanly */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Set page margins for letter size */
    @page {
        margin: 0.75in;
        size: letter;
    }

    /* Ensure output content prints well */
    .output-content {
        background: white !important;
        border: none !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .output-content pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        page-break-inside: avoid;
        font-size: 10pt;
    }

    /* Ensure headings and text are readable */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }

    p, li {
        color: black !important;
        orphans: 3;
        widows: 3;
    }

    /* Hide background patterns */
    body::before,
    .container::before,
    .pattern-overlay {
        display: none !important;
    }
}
