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

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --border-color: #e2e8f0;
    --hint-color: #fef3c7;
    --hint-border: #fbbf24;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header h1 i {
    margin-right: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* Progress Bar */
.progress-container {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.5s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--white);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.95;
}

.progress-percentage {
    font-weight: 600;
}

/* Pamphlets Section */
.pamphlets-section {
    padding: 40px;
    background: var(--light-bg);
}

.pamphlets-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.pamphlets-section h2 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.instruction {
    color: var(--text-gray);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.pamphlets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.pamphlet-wrapper h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.pamphlet-image-container {
    position: relative;
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pamphlet-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.pamphlet-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    cursor: zoom-in;
    display: block;
    max-width: 100%;
}

.zoom-btn {
    position: absolute;
    bottom: 25px;
    right: 25px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.zoom-btn:hover {
    background: #1e40af;
    transform: scale(1.05);
}

.zoom-btn i {
    margin-right: 5px;
}

/* Questions Section */
.questions-section {
    padding: 40px;
}

.questions-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.questions-section h2 i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.question-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

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

.completion-badge {
    font-size: 1.2rem;
    color: var(--text-gray);
}

.completion-badge.completed {
    color: var(--success-color);
}

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

.question-en {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.question-ko {
    font-size: 1rem;
    color: var(--text-gray);
}

.answer-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.question-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hint {
    background: var(--hint-color);
    color: #92400e;
    border: 2px solid var(--hint-border);
}

.btn-hint:hover {
    background: var(--hint-border);
    color: var(--white);
}

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

.btn-check:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.hint-box {
    background: var(--hint-color);
    border-left: 4px solid var(--hint-border);
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
    color: #78350f;
    animation: slideDown 0.3s ease;
}

.hint-box i {
    margin-right: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-box {
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.feedback-box.success {
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.feedback-box.warning {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

.feedback-box.info {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    color: #1e40af;
}

/* Action Section */
.action-section {
    padding: 40px;
    background: var(--light-bg);
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--text-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

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

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
}

.modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px 20px;
    cursor: zoom-out;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: zoom 0.3s;
    cursor: default;
}

@keyframes zoom {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--white);
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: var(--warning-color);
    cursor: pointer;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: var(--white);
    padding: 20px;
    font-size: 1.2rem;
}

/* Print Styles */
@media print {
    body {
        background: var(--white);
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .header {
        background: none;
        color: var(--text-dark);
    }

    .action-section,
    .zoom-btn,
    .question-actions {
        display: none !important;
    }

    .question-card {
        page-break-inside: avoid;
        border: 1px solid var(--border-color);
    }

    .pamphlet-image {
        max-height: 400px;
        object-fit: contain;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pamphlets-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .pamphlets-section,
    .questions-section,
    .action-section {
        padding: 20px;
    }

    .question-card {
        padding: 20px;
    }

    .question-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .pamphlets-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .questions-section h2,
    .pamphlets-section h2 {
        font-size: 1.5rem;
    }

    .question-en {
        font-size: 1rem;
    }

    .question-ko {
        font-size: 0.9rem;
    }
}

/* Accessibility */
.btn:focus,
.answer-input:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.completion-badge.completed {
    animation: pulse 2s ease-in-out infinite;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}