/* ============================================================================
   Custom Font
   ============================================================================ */

@font-face {
    font-family: 'NanumGothic';
    src: url('../fonts/NanumGothic.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NanumPen';
    src: url('../fonts/NanumPen.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KyungkiBatang';
    src: url('../fonts/KyungkiBatang/woff/Batang_Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KyungkiBatang';
    src: url('../fonts/KyungkiBatang/woff/Batang_Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KyungkiBatangTitle';
    src: url('../fonts/KyungkiBatang/woff/Title_Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KyungkiBatangTitle';
    src: url('../fonts/KyungkiBatang/woff/Title_Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KyungkiBatangTitle';
    src: url('../fonts/KyungkiBatang/woff/Title_Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================================================
   Global Styles
   ============================================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'KyungkiBatang', 'NanumGothic', 'Inter', 'Segoe UI', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }
}

/* ============================================================================
   Container and Layout
   ============================================================================ */

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    max-width: 1000px;
    width: 100%;
    padding: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================================================
   Animations
   ============================================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        text-decoration-color: #e53e3e;
    }
    50% {
        text-decoration-color: #fc8181;
    }
}

@keyframes pulseAlt {
    0%, 100% {
        text-decoration-color: #f59e0b;
    }
    50% {
        text-decoration-color: #fbbf24;
    }
}

@keyframes pulseDouble {
    0%, 100% {
        text-decoration-color: #9333ea;
    }
    50% {
        text-decoration-color: #c084fc;
    }
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================================
   Typography
   ============================================================================ */

h1 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 3em;
    font-weight: 700;
    font-family: 'KyungkiBatangTitle', 'NanumGothic', serif;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideIn 0.8s ease-out;
}

.subtitle {
    color: #718096;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-family: 'KyungkiBatangTitle', 'NanumGothic', serif;
    font-weight: 300;
    text-align: center;
}

.tagline {
    color: #a0aec0;
    margin-bottom: 40px;
    font-size: 0.95em;
    font-family: 'KyungkiBatang', 'NanumGothic', serif;
    text-align: center;
    font-weight: 400;
}

/* ============================================================================
   Quick Answer Section
   ============================================================================ */

.quick-answer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.9));
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
}

.quick-answer h2 {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
}

.quick-answer p {
    font-size: 1rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 0;
    font-family: 'KyungkiBatang', serif;
}

.quick-answer strong {
    color: #2d3748;
    font-weight: 600;
}

.how-section-title {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-family: 'NanumGothic', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
}

/* ============================================================================
   Input Section
   ============================================================================ */

.input-section {
    margin-bottom: 30px;
}

/* ============================================================================
   OVERLAY EDITOR - Core Structure
   ============================================================================ */

.editor-overlay-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    overflow: hidden; /* Prevent scrollbar doubling */
    transition: border-color 0.3s;
}

.editor-overlay-wrapper:focus-within {
    border-color: #667eea;
}

/* Layer 1 (Bottom): Transparent Input Textarea */
.editor-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    margin: 0;
    border: none;
    outline: none;
    resize: none;
    
    /* Typography - Must match display exactly */
    font-size: 18px;
    font-family: 'KyungkiBatang', 'NanumGothic', serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0;
    word-spacing: 0;
    
    /* Transparency Effect */
    color: transparent;              /* Hide typed text */
    background: transparent;         /* Hide background */
    caret-color: #2d3748;           /* Show cursor */
    
    /* Scroll behavior */
    overflow: auto;
    white-space: pre-wrap;          /* Preserve line breaks */
    word-wrap: break-word;
    
    /* Layering - BELOW display, but receives clicks through pointer-events:none */
    z-index: 1;  /* Below display */
    
    /* Disable browser features */
    tab-size: 4;                    /* Consistent tab width */
    
    /* Mobile-specific fixes for input responsiveness */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
}

/* Placeholder styling for textarea */
.editor-input::placeholder {
    color: #a0aec0;
    font-style: italic;
    opacity: 1;
}

.editor-input::-webkit-input-placeholder {
    color: #a0aec0;
    font-style: italic;
}

.editor-input::-moz-placeholder {
    color: #a0aec0;
    font-style: italic;
    opacity: 1;
}

.editor-input:-ms-input-placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Layer 2 (Top): Visible Display Div - Shows highlighted text */
.editor-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    margin: 0;
    border: none;
    
    /* Typography - Must match input exactly */
    font-size: 18px;
    font-family: 'KyungkiBatang', 'NanumGothic', serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0;
    word-spacing: 0;
    
    /* Visibility */
    color: #2d3748;                 /* Show text */
    background: transparent;
    
    /* Scroll behavior - synced with textarea */
    overflow: auto;
    white-space: pre-wrap;          /* Match textarea */
    word-wrap: break-word;
    
    /* Layering - ABOVE textarea to show error highlights */
    z-index: 2;
    
    /* Interaction - clicks pass through to textarea EXCEPT error-word */
    pointer-events: none;
    
    /* Text rendering - must match textarea */
    tab-size: 4;
}

/* Error highlights on display layer */
.editor-display .error-word {
    /* 에러만 클릭 가능하도록 */
    pointer-events: auto;
    cursor: pointer;
    
    /* Keep existing error-word styles */
    background-color: rgba(239, 68, 68, 0.25);
    text-decoration: underline wavy #ef4444;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    border-radius: 2px;
    transition: all 0.2s;
}

.editor-display .error-word:hover {
    background-color: rgba(239, 68, 68, 0.35);
}

/* Mobile: larger touch target for error words */
@media (max-width: 768px) {
    .editor-display .error-word {
        padding: 4px 2px;
        margin: -4px -2px;
        background-color: rgba(239, 68, 68, 0.35);
        border-radius: 4px;
    }
}

/* ============================================================================
   Error Highlighting
   ============================================================================ */

.error-highlight {
    text-decoration: underline wavy;
    text-decoration-color: #e53e3e;
    text-decoration-thickness: 1.5px;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 2px;
    animation: pulse 2s infinite;
}

.error-highlight:hover {
    background-color: rgba(229, 62, 62, 0.1);
    text-decoration-thickness: 2px;
}

.error-highlight-alt {
    text-decoration: underline wavy;
    text-decoration-color: #f59e0b;
    text-decoration-thickness: 1.5px;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 2px;
    animation: pulseAlt 2s infinite;
}

.error-highlight-alt:hover {
    background-color: rgba(245, 158, 11, 0.1);
    text-decoration-thickness: 2px;
}

.error-highlight-double {
    text-decoration: underline wavy;
    text-decoration-style: wavy;
    text-decoration-color: #9333ea;
    text-decoration-thickness: 2px;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 2px;
    animation: pulseDouble 2s infinite;
    box-shadow: 0 3px 0 -1px #c084fc;
}

.error-highlight-double:hover {
    background-color: rgba(147, 51, 234, 0.1);
    text-decoration-thickness: 2.5px;
}

/* ============================================================================
   Tooltip Styles
   ============================================================================ */

.error-tooltip {
    position: fixed;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
    backdrop-filter: blur(20px);
    color: #1a202c;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 18px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    box-shadow: 
        0 10px 30px -5px rgba(102, 126, 234, 0.3),
        0 5px 15px -3px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(102, 126, 234, 0.05);
    z-index: 10000;
    opacity: 1;
    pointer-events: auto;
    max-width: 320px;
    word-wrap: break-word;
    text-align: left;
    animation: tooltipFadeIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.error-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.98);
    border-top: none;
    filter: drop-shadow(0 -2px 3px rgba(102, 126, 234, 0.1));
}

.error-tooltip.tooltip-below::before {
    top: auto;
    bottom: -8px;
    border-bottom: none;
    border-top-color: rgba(255, 255, 255, 0.98);
    filter: drop-shadow(0 2px 3px rgba(102, 126, 234, 0.1));
}

@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================================
   Tooltip Buttons
   ============================================================================ */

.tooltip-buttons {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.tooltip-btn {
    padding: 8px 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'NanumGothic', sans-serif;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.08);
    letter-spacing: 0.01em;
}

.tooltip-btn.accept {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.tooltip-btn.accept:hover {
    background: linear-gradient(135deg, #5568d3, #6a4193);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tooltip-btn.accept:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.tooltip-btn.dismiss {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.08));
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
    font-weight: 500;
}

.tooltip-btn.dismiss:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.tooltip-btn.dismiss:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'NanumGothic', sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================================
   Statistics and Cards
   ============================================================================ */

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    min-width: 150px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-label {
    color: #718096;
    font-size: 12px;
    font-family: 'NanumGothic', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    font-family: 'KyungkiBatangTitle', serif;
}

/* ============================================================================
   Results Section
   ============================================================================ */

.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.errors-container {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.error-item {
    background: white;
    border-left: 4px solid #e53e3e;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'KyungkiBatang', serif;
}

.error-item.warning {
    border-left-color: #f59e0b;
}

.error-message {
    font-weight: 600;
    font-family: 'KyungkiBatang', serif;
    color: #2d3748;
    margin-bottom: 4px;
}

.error-context {
    color: #718096;
    font-size: 12px;
    font-family: 'KyungkiBatang', 'Courier New', monospace;
}

.no-errors {
    color: #48bb78;
    font-family: 'KyungkiBatang', serif;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

/* ============================================================================
   Features Section
   ============================================================================ */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.feature-card {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.feature-title {
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
    color: #2d3748;
    margin-bottom: 8px;
}

.feature-description {
    color: #718096;
    font-size: 14px;
    font-family: 'KyungkiBatang', serif;
    line-height: 1.5;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #a0aec0;
    font-size: 14px;
    font-family: 'KyungkiBatang', serif;
}

.last-updated {
    margin-top: 8px;
    font-size: 12px;
    color: #cbd5e0;
    font-family: 'KyungkiBatang', serif;
}

.copy-btn {
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 12px;
    background: #edf2f7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #4a5568;
    font-family: 'NanumGothic', sans-serif;
}

.copy-btn:hover {
    background: #e2e8f0;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        border-radius: 16px;
        margin: 0;
        max-width: 100%;
    }

    h1 {
        font-size: 1.6em;
        line-height: 1.3;
    }

    .subtitle {
        font-size: 0.95em;
    }

    .tagline {
        font-size: 0.85em;
        margin-bottom: 25px;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-card {
        min-width: 100%;
        padding: 15px;
    }

    .stat-value {
        font-size: 20px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 30px;
        padding-top: 30px;
    }

    .feature-card {
        padding: 15px;
    }

    .feature-icon {
        font-size: 24px;
    }

    .feature-title {
        font-size: 0.95rem;
    }

    .feature-description {
        font-size: 0.85rem;
    }

    .info-section {
        margin-top: 2rem;
    }
    
    .info-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .info-tab {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .info-grid, .faq-grid, .mistakes-grid, .detect-grid {
        grid-template-columns: 1fr;
    }

    .info-item, .faq-item, .mistake-item, .detect-item {
        padding: 1rem;
    }

    .editor-overlay-wrapper {
        height: 250px;
    }

    .editor-input, .editor-display {
        font-size: 16px;
        padding: 12px;
        line-height: 1.6;
    }

    .results-section {
        margin-top: 20px;
        padding-top: 20px;
    }

    .errors-container {
        padding: 15px;
        max-height: 200px;
    }

    .quick-answer {
        padding: 18px 20px;
    }

    .quick-answer h2 {
        font-size: 1.1rem;
    }

    .quick-answer p {
        font-size: 0.9rem;
    }

    label {
        font-size: 1rem;
    }
}

/* ============================================================================
   Info Section (Tabs UI)
   ============================================================================ */

.info-section {
    margin-top: 3rem;
}

.info-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.info-tab {
    padding: 0.75rem 2rem;
    background: none !important;
    border: none;
    border-bottom: 3px solid transparent;
    color: #718096 !important;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    font-family: inherit;
}

.info-tab:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.03) !important;
}

.info-tab.active {
    color: #667eea !important;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.info-content {
    min-height: 200px;
    overflow: hidden;
}

.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.info-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    box-sizing: border-box;
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.info-item h3 {
    font-size: 1.1rem;
    color: #2d3748 !important;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
}

.info-item p {
    color: #718096 !important;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    font-family: 'KyungkiBatang', serif;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.faq-item {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.faq-item strong {
    display: block;
    color: #2d3748 !important;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
}

.faq-item p {
    color: #718096 !important;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-family: 'KyungkiBatang', serif;
}

/* Common Mistakes Grid */
.mistakes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.mistake-item {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 249, 245, 0.8), rgba(255, 255, 255, 0.5)) !important;
    border-radius: 12px;
    border: 1px solid rgba(245, 101, 101, 0.15);
    transition: all 0.3s ease;
}

.mistake-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(245, 101, 101, 0.1);
    border-color: rgba(245, 101, 101, 0.25);
}

.mistake-item h3 {
    font-size: 1.05rem;
    color: #c53030 !important;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
}

.mistake-item p {
    color: #4a5568 !important;
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    font-family: 'KyungkiBatang', serif;
}

.mistake-item strong {
    color: #2d3748;
    font-weight: 600;
}

.mistake-item em {
    color: #667eea;
    font-style: normal;
    font-weight: 500;
}

/* What We Detect Grid */
.detect-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.detect-item {
    padding: 1.75rem;
    background: linear-gradient(135deg, rgba(237, 242, 247, 0.8), rgba(255, 255, 255, 0.6)) !important;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    box-sizing: border-box;
}

.detect-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.detect-item h3 {
    font-size: 1.1rem;
    color: #2d3748 !important;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-family: 'KyungkiBatangTitle', serif;
}

.detect-item p {
    color: #4a5568 !important;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
    font-family: 'KyungkiBatang', serif;
}

/* ============================================================================
   Navigation Bar (Multi-page)
   ============================================================================ */

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 25px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.nav-logo {
    font-family: 'KyungkiBatangTitle', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-logo:hover {
    color: #764ba2;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #718096;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'KyungkiBatang', serif;
    transition: color 0.3s;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: #667eea;
}

.nav-links a.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ============================================================================
   Page Content (Multi-page)
   ============================================================================ */

.page-content {
    padding: 20px 0;
}

.page-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.page-subtitle {
    color: #718096;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 40px;
    font-family: 'KyungkiBatang', serif;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    color: #2d3748;
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-family: 'KyungkiBatangTitle', serif;
    font-weight: 600;
}

.content-section h3 {
    color: #4a5568;
    font-size: 1.2rem;
    margin-bottom: 12px;
    margin-top: 24px;
    font-family: 'KyungkiBatangTitle', serif;
    font-weight: 600;
}

.content-section p {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
    font-family: 'KyungkiBatang', serif;
}

.content-section ul, .content-section ol {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
    padding-left: 24px;
    font-family: 'KyungkiBatang', serif;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.content-section a:hover {
    border-bottom-color: #667eea;
}

/* Benefits Grid (About page) */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.benefit-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.benefit-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.benefit-item h3 {
    margin-top: 0;
    color: #2d3748;
}

.benefit-item p {
    margin-bottom: 0;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-list li:last-child {
    border-bottom: none;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 40px;
    border-radius: 16px;
    margin-top: 50px;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 16px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'NanumGothic', sans-serif;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Steps (Guide page) */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.step-item {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'KyungkiBatangTitle', serif;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.step-tip {
    background: rgba(102, 126, 234, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin-top: 16px;
}

/* Error demos */
.error-demo {
    padding: 2px 4px;
    border-radius: 3px;
}

.error-demo.spelling {
    text-decoration: underline wavy #e53e3e;
}

.error-demo.grammar {
    text-decoration: underline wavy #f59e0b;
}

.error-demo.style {
    text-decoration: underline wavy #9333ea;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.tip-card h3 {
    margin-top: 0;
    font-size: 1rem;
}

.tip-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* FAQ Full Items */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-item-full {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item-full h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #2d3748;
}

.faq-item-full p {
    margin-bottom: 12px;
}

.faq-item-full p:last-child {
    margin-bottom: 0;
}

.faq-item-full ul {
    margin-bottom: 0;
}

/* Mistake Cards (Common Mistakes page) */
.mistake-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mistake-card h3 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.mistake-card .example {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.mistake-card .example.wrong {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #e53e3e;
}

.mistake-card .example.correct {
    background: rgba(72, 187, 120, 0.08);
    border-left: 3px solid #48bb78;
}

.mistake-card .example .label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
}

.mistake-card .example p {
    margin: 0;
    font-family: 'KyungkiBatang', serif;
    font-size: 1.05rem;
}

.mistake-card .explanation {
    background: rgba(102, 126, 234, 0.05);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.mistake-card .explanation ul {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Privacy Page */
.privacy-highlight {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(56, 161, 105, 0.1));
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(72, 187, 120, 0.2);
    text-align: center;
}

.privacy-highlight h2 {
    color: #2f855a;
    margin-bottom: 12px;
}

.privacy-highlight p {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.dont-list {
    list-style: none;
    padding-left: 0;
}

.dont-list li {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #667eea;
}

/* Responsive for new pages */
@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }
    
    .benefits-grid,
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .step-content h2 {
        text-align: center;
    }
    
    .step-tip {
        text-align: left;
    }
    
    .footer-links {
        gap: 12px 16px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .cta-section {
        padding: 30px 20px;
    }

    /* Info Section Mobile Fixes */
    .info-section {
        margin-top: 1.5rem;
    }

    .info-tabs {
        flex-wrap: wrap;
        gap: 0.4rem;
        border-bottom: none;
        justify-content: center;
    }

    .info-tab {
        flex: 1 1 45%;
        min-width: 120px;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        text-align: center;
        border: 1px solid rgba(102, 126, 234, 0.2);
        border-radius: 8px;
        margin-bottom: 0;
    }

    .info-tab.active {
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: white !important;
        border-color: transparent;
    }

    .info-content {
        min-height: auto;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-item {
        padding: 1rem;
    }

    .info-item h3 {
        font-size: 1rem;
    }

    .info-item p {
        font-size: 0.85rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .faq-item {
        padding: 1rem;
    }

    .faq-item strong {
        font-size: 0.9rem;
    }

    .faq-item p {
        font-size: 0.85rem;
    }

    .mistakes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mistake-item {
        padding: 1rem;
    }

    .mistake-item h3 {
        font-size: 0.95rem;
    }

    .mistake-item p {
        font-size: 0.85rem;
    }

    .detect-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detect-item {
        padding: 1rem;
    }

    .detect-item h3 {
        font-size: 0.95rem;
    }

    .detect-item p {
        font-size: 0.85rem;
    }

    .quick-answer {
        padding: 15px;
        margin-bottom: 15px;
    }

    .quick-answer h2 {
        font-size: 1rem;
    }

    .quick-answer p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .how-section-title {
        font-size: 1rem;
        margin-top: 0;
    }

    /* Footer Mobile */
    .footer {
        margin-top: 25px;
        padding-top: 15px;
        font-size: 0.8rem;
    }

    .footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .last-updated {
        font-size: 0.7rem;
    }

    /* Tooltip Mobile */
    .error-tooltip {
        max-width: 280px;
        padding: 14px 16px;
        font-size: 12px;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }

    .tooltip-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .tooltip-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ============================================================================
   Error List Cards (Mobile-Friendly)
   ============================================================================ */

.error-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.error-count-badge {
    background: white;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.error-list-hint {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.error-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.error-card:last-child {
    border-bottom: none;
}

.error-card:hover {
    background: #f0f4ff;
}

.error-card:active {
    background: #e0e7ff;
    transform: scale(0.99);
}

.error-card-content {
    flex: 1;
    min-width: 0;
}

.error-card-word {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.wrong-word {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: line-through;
    font-size: 0.95rem;
}

.arrow {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
}

.suggested-word {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
}

.error-card-message {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.error-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.error-btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.error-btn-apply:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.error-btn-dismiss {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.error-btn-dismiss:hover {
    background: #e2e8f0;
}

/* ============================================================================
   Mobile Responsive - Complete Overhaul
   ============================================================================ */

@media (max-width: 480px) {
    /* Base */
    body {
        padding: 8px;
    }
    
    .container {
        padding: 16px 12px;
        border-radius: 12px;
    }
    
    /* Header */
    h1 {
        font-size: 1.4rem;
        line-height: 1.2;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .tagline {
        font-size: 0.8rem;
        margin-bottom: 16px;
    }
    
    /* Navigation */
    .nav-bar {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .nav-links a {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    /* Editor */
    .editor-overlay-wrapper {
        height: 200px;
        border-radius: 8px;
    }
    
    .editor-input, .editor-display {
        font-size: 16px;
        padding: 10px;
        line-height: 1.5;
    }
    
    label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    /* Stats */
    .stats {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .stat-card {
        padding: 10px 8px;
        min-width: 0;
        flex: 1;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    /* Error List Cards - Mobile */
    .errors-container {
        padding: 0;
        max-height: none;
        overflow: visible;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .error-list-header {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 12px 12px 0 0;
    }
    
    .error-count-badge {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .error-list-hint {
        font-size: 0.7rem;
    }
    
    .error-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 10px;
    }
    
    .error-card-word {
        margin-bottom: 4px;
    }
    
    .wrong-word, .suggested-word {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
    
    .error-card-message {
        font-size: 0.8rem;
    }
    
    .error-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .error-btn-apply {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .error-btn-dismiss {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    /* Features Grid */
    .features {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .feature-card {
        padding: 12px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        text-align: left;
    }
    
    .feature-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    
    .feature-title {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }
    
    .feature-description {
        font-size: 0.75rem;
        display: none;
    }
    
    /* Info Section - Tabs */
    .info-section {
        margin-top: 20px;
    }
    
    .info-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        border-bottom: none;
        padding: 0;
    }
    
    .info-tab {
        padding: 10px 8px;
        font-size: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f8fafc;
        margin-bottom: 0;
        text-align: center;
        white-space: nowrap;
    }
    
    .info-tab.active {
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: white !important;
        border-color: transparent !important;
    }
    
    /* Info Content */
    .info-content {
        min-height: auto;
        padding: 0;
        margin-top: 12px;
        overflow: hidden;
        width: 100%;
    }
    
    .tab-content {
        padding: 0;
        overflow: hidden;
        width: 100%;
    }
    
    .quick-answer {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .quick-answer h2 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .quick-answer p {
        font-size: 0.8rem;
        line-height: 1.5;
        word-wrap: break-word;
    }
    
    .how-section-title {
        font-size: 0.9rem;
        margin: 12px 0 8px 0;
    }
    
    /* Info Grids */
    .info-grid,
    .faq-grid,
    .mistakes-grid,
    .detect-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .info-item,
    .faq-item,
    .mistake-item,
    .detect-item {
        padding: 12px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        word-wrap: break-word;
    }
    
    .info-item h3,
    .mistake-item h3,
    .detect-item h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
        word-wrap: break-word;
    }
    
    .info-item p,
    .faq-item p,
    .mistake-item p,
    .detect-item p {
        font-size: 0.8rem;
        line-height: 1.4;
        word-wrap: break-word;
    }
    
    .faq-item strong {
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer {
        margin-top: 20px;
        padding-top: 16px;
    }
    
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 12px;
        justify-content: center;
        align-items: center;
    }
    
    .footer-links a {
        font-size: 0.7rem;
    }
    
    .footer p {
        font-size: 0.7rem;
        text-align: center;
        line-height: 1.4;
    }
    
    .last-updated {
        font-size: 0.65rem;
    }
}
