@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

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

:root {
    --primary-dark: #0a1520;
    --secondary-dark: #0f1f2e;
    --teal-victorian: #2d5a6f;
    --teal-light: #5a8fa3;
    --purple: #7b5b7e;
    --purple-light: #a88fa0;
    --red: #c74541;
    --orange: #d8804d;
    --seafoam: #4a9b8a;
    --royal-blue: #3b5f8a;
    --lime: #6fa876;
    --cream: #f5f1e8;
    --text-light: #e8e4d8;
    --text-muted: #a89f91;
    --sci-fi-blue: #00d9ff;
    --sci-fi-purple: #ff00ff;
    --sci-fi-grid: #1a3a4a;
}

body {
    font-family: 'EB Garamond', serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    font-size: 16px;
    letter-spacing: 0.3px;
}

/* Monospace font for RocketPrep.Comic references */
.rocket-prep-font {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Header */
.comic-header {
    background: linear-gradient(135deg, var(--secondary-dark), var(--sci-fi-grid));
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--sci-fi-blue);
    flex-wrap: wrap;
    gap: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(0, 217, 255, 0.1), 0 0 20px rgba(0, 217, 255, 0.1);
    position: relative;
}

.comic-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.03) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 217, 255, 0.03) 3px
    );
    pointer-events: none;
    z-index: 1;
}

.back-button {
    color: var(--sci-fi-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-style: italic;
    position: relative;
    z-index: 2;
}

.back-button:hover {
    color: var(--sci-fi-purple);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.comic-header h1 {
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--sci-fi-blue), var(--sci-fi-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

.page-counter {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(255, 0, 255, 0.1));
    padding: 0.6rem 1.2rem;
    border-radius: 0;
    font-weight: 600;
    color: var(--sci-fi-blue);
    font-style: italic;
    border: 2px solid var(--sci-fi-blue);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 0 10px rgba(0, 217, 255, 0.1);
}

/* Comic Container */
.comic-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Flipbook */
.flipbook-wrapper {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
    perspective: 1000px;
}

.book {
    display: flex;
    background: linear-gradient(135deg, var(--secondary-dark), var(--primary-dark));
    border-radius: 2px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(0, 217, 255, 0.1), 0 0 30px rgba(0, 217, 255, 0.15);
    padding: 1.5rem;
    max-width: 900px;
    width: 100%;
    border: 3px solid var(--sci-fi-blue);
    position: relative;
}

.book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.02) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 217, 255, 0.02) 3px
    );
    pointer-events: none;
    border-radius: 2px;
}

.book-spine-left,
.book-spine-right {
    width: 18px;
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.2), transparent);
    border-radius: 2px;
}

.book-spine-right {
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.2));
}

.pages-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    align-items: center;
    position: relative;
    z-index: 2;
}

.page {
    background: var(--cream);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.2);
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid var(--sci-fi-blue);
}

.page:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 217, 255, 0.4);
}

.page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.08), transparent);
    pointer-events: none;
    z-index: 1;
}

.page-right::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.08));
    pointer-events: none;
    z-index: 1;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.nav-button {
    padding: 0.8rem 1.8rem;
    background: linear-gradient(135deg, var(--sci-fi-blue), var(--sci-fi-purple));
    color: var(--primary-dark);
    border: 2px solid var(--sci-fi-blue);
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3), inset 0 0 10px rgba(0, 217, 255, 0.1);
    text-transform: uppercase;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.6), inset 0 0 15px rgba(0, 217, 255, 0.2);
    background: linear-gradient(135deg, var(--sci-fi-purple), var(--sci-fi-blue));
}

.nav-button:active {
    transform: translateY(-1px);
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.slider-container {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
}

.page-slider {
    width: 100%;
    height: 8px;
    background: var(--secondary-dark);
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--sci-fi-blue);
    box-shadow: inset 0 0 10px rgba(0, 217, 255, 0.1);
}

.page-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--sci-fi-blue), var(--sci-fi-purple));
    cursor: pointer;
    border-radius: 0;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
    border: 2px solid var(--sci-fi-purple);
}

.page-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--sci-fi-blue), var(--sci-fi-purple));
    cursor: pointer;
    border-radius: 0;
    border: 2px solid var(--sci-fi-purple);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
}

.nav-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Q&A Section */
.qna-section {
    background-color: var(--secondary-dark);
    padding: 3.5rem 2rem;
    margin: 3rem 0 0 0;
    border-top: 4px solid var(--sci-fi-blue);
    position: relative;
}

.qna-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.03) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 217, 255, 0.03) 3px
    );
    pointer-events: none;
}

.qna-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--sci-fi-blue);
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.qna-section > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-style: italic;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

.qna-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

/* Q&A Form */
.qna-form {
    background-color: var(--primary-dark);
    padding: 2.5rem;
    border-radius: 0;
    border: 2px solid var(--sci-fi-blue);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2), inset 0 0 10px rgba(0, 217, 255, 0.05);
}

.qna-form h3 {
    color: var(--sci-fi-blue);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.9rem;
    margin-bottom: 1rem;
    background-color: var(--secondary-dark);
    border: 2px solid var(--sci-fi-blue);
    border-radius: 0;
    color: var(--text-light);
    font-family: 'EB Garamond', serif;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: inset 0 0 10px rgba(0, 217, 255, 0.05);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--sci-fi-purple);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3), inset 0 0 10px rgba(0, 217, 255, 0.1);
}

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

.submit-button {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--sci-fi-blue), var(--sci-fi-purple));
    color: var(--primary-dark);
    border: 2px solid var(--sci-fi-purple);
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.6);
    background: linear-gradient(135deg, var(--sci-fi-purple), var(--sci-fi-blue));
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 0;
    text-align: center;
    display: none;
    font-weight: 500;
}

.form-message.success {
    display: block;
    background-color: rgba(0, 217, 255, 0.15);
    color: var(--sci-fi-blue);
    border: 2px solid var(--sci-fi-blue);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.form-message.error {
    display: block;
    background-color: rgba(199, 69, 65, 0.15);
    color: var(--red);
    border: 2px solid var(--red);
    box-shadow: 0 0 15px rgba(199, 69, 65, 0.2);
}

/* Q&A Display */
.qna-display {
    background-color: var(--primary-dark);
    padding: 2.5rem;
    border-radius: 0;
    border: 2px solid var(--sci-fi-blue);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2), inset 0 0 10px rgba(0, 217, 255, 0.05);
}

.qna-display h3 {
    color: var(--sci-fi-blue);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.qna-list {
    max-height: 500px;
    overflow-y: auto;
}

.qna-item {
    background-color: var(--secondary-dark);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0;
    border-left: 4px solid var(--sci-fi-purple);
    border: 2px solid var(--sci-fi-blue);
    border-left: 4px solid var(--sci-fi-purple);
    animation: slideIn 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.qna-item.answer {
    border-left-color: var(--sci-fi-blue);
    margin-left: 1rem;
}

.qna-question {
    font-weight: 600;
    color: var(--sci-fi-purple);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-family: 'Courier New', monospace;
}

.qna-answer {
    color: var(--sci-fi-blue);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.qna-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Footer */
footer {
    background-color: var(--secondary-dark);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 4px solid var(--sci-fi-blue);
    font-style: italic;
    box-shadow: inset 0 1px 0 rgba(0, 217, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .comic-header {
        flex-direction: column;
        padding: 1.5rem;
    }

    .comic-header h1 {
        order: -1;
        width: 100%;
        font-size: 1.8rem;
    }

    .pages-container {
        grid-template-columns: 1fr;
    }

    .book {
        padding: 0.75rem;
    }

    .book-spine-left,
    .book-spine-right {
        display: none;
    }

    .controls {
        gap: 1rem;
    }

    .nav-button {
        flex: 1;
        min-width: 100px;
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }

    .slider-container {
        max-width: 100%;
    }

    .qna-container {
        grid-template-columns: 1fr;
    }

    .qna-item.answer {
        margin-left: 0.5rem;
    }

    .qna-form,
    .qna-display {
        padding: 1.5rem;
    }
}
