/* ThisGun Edu - Common Styles */
/* ========================== */

/* Reset & Base */
.tg-edu-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

.tg-edu-wrap * {
    box-sizing: border-box;
}

/* Header */
.tg-edu-header {
    text-align: center;
    margin-bottom: 30px;
}

.tg-edu-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.tg-edu-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* Start Screen */
.tg-edu-start {
    text-align: center;
    padding: 40px 20px;
}

.tg-edu-start .tg-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.tg-edu-start p {
    font-size: 16px;
    color: #555;
    margin-bottom: 24px;
}

/* Buttons */
.tg-btn {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.tg-btn:active {
    transform: scale(0.97);
}

/* Blue theme (spelling) */
.tg-theme-blue .tg-btn-primary {
    background: #3b82f6;
    color: #fff;
}
.tg-theme-blue .tg-btn-primary:hover {
    background: #2563eb;
}
.tg-theme-blue .tg-progress-fill {
    background: #3b82f6;
}
.tg-theme-blue .tg-option-btn.selected.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.tg-theme-blue .tg-option-btn.selected.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}
.tg-theme-blue .tg-edu-header h2 {
    color: #1e40af;
}

/* Orange theme (trivia) */
.tg-theme-orange .tg-btn-primary {
    background: #f97316;
    color: #fff;
}
.tg-theme-orange .tg-btn-primary:hover {
    background: #ea580c;
}
.tg-theme-orange .tg-progress-fill {
    background: #f97316;
}
.tg-theme-orange .tg-option-btn.selected.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.tg-theme-orange .tg-option-btn.selected.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}
.tg-theme-orange .tg-edu-header h2 {
    color: #c2410c;
}

/* Dark Red theme (idiom) */
.tg-theme-darkred .tg-btn-primary {
    background: #991b1b;
    color: #fff;
}
.tg-theme-darkred .tg-btn-primary:hover {
    background: #7f1d1d;
}
.tg-theme-darkred .tg-progress-fill {
    background: #991b1b;
}
.tg-theme-darkred .tg-edu-header h2 {
    color: #7f1d1d;
}
.tg-theme-darkred .tg-option-btn.selected.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.tg-theme-darkred .tg-option-btn.selected.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Green theme (proverb) */
.tg-theme-green .tg-btn-primary {
    background: #16a34a;
    color: #fff;
}
.tg-theme-green .tg-btn-primary:hover {
    background: #15803d;
}
.tg-theme-green .tg-progress-fill {
    background: #16a34a;
}
.tg-theme-green .tg-option-btn.selected.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.tg-theme-green .tg-option-btn.selected.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}
.tg-theme-green .tg-edu-header h2 {
    color: #166534;
}

/* Progress Bar */
.tg-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tg-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.tg-progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

/* Question Card */
.tg-question-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.tg-question-num {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tg-question-sentence {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
    word-break: keep-all;
}

/* Option Buttons (2 choices - spelling) */
.tg-options-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Option Buttons (4 choices - trivia/proverb) */
.tg-options-four {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.tg-option-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    word-break: keep-all;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.tg-option-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.tg-option-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.tg-option-btn.correct-answer {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
    opacity: 1 !important;
}

/* Explanation */
.tg-explanation {
    margin-top: 16px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.6;
    animation: tg-fadeIn 0.3s ease;
}

.tg-theme-orange .tg-explanation {
    background: #fff7ed;
    border-left-color: #f97316;
    color: #9a3412;
}

.tg-theme-darkred .tg-explanation {
    background: #fef2f2;
    border-left-color: #991b1b;
    color: #7f1d1d;
}

.tg-theme-green .tg-explanation {
    background: #f0fdf4;
    border-left-color: #16a34a;
    color: #166534;
}

/* Timer */
.tg-timer {
    text-align: center;
    margin-bottom: 16px;
}

.tg-timer-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.tg-timer-fill {
    height: 100%;
    background: #f97316;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.tg-timer-fill.warning {
    background: #ef4444;
}

.tg-timer-text {
    font-size: 13px;
    color: #999;
}

/* Result Screen */
.tg-result {
    text-align: center;
    padding: 32px 20px;
}

.tg-result-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.tg-result-score {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tg-result-total {
    font-size: 18px;
    color: #666;
    margin-bottom: 16px;
}

.tg-result-rating {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    padding: 12px 24px;
    border-radius: 12px;
    display: inline-block;
}

.tg-rating-excellent {
    background: #dcfce7;
    color: #166534;
}

.tg-rating-good {
    background: #dbeafe;
    color: #1e40af;
}

.tg-rating-average {
    background: #fef3c7;
    color: #92400e;
}

.tg-rating-poor {
    background: #fee2e2;
    color: #991b1b;
}

.tg-result-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.tg-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.tg-btn-secondary:hover {
    background: #e5e7eb;
}

/* Share */
.tg-share-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: #555;
    margin: 16px 0;
    word-break: keep-all;
}

.tg-copied-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: tg-fadeInUp 0.3s ease;
}

/* ========================== */
/* Idiom Dictionary Specific  */
/* ========================== */

.tg-idiom-search {
    position: relative;
    margin-bottom: 24px;
}

.tg-idiom-search input {
    width: 100%;
    padding: 14px 20px 14px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.tg-idiom-search input:focus {
    border-color: #991b1b;
}

.tg-idiom-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
}

.tg-idiom-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tg-tab-btn {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tg-tab-btn.active {
    background: #991b1b;
    color: #fff;
    border-color: #991b1b;
}

.tg-tab-btn:hover:not(.active) {
    background: #f9fafb;
}

/* Idiom Card */
.tg-idiom-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.tg-idiom-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.tg-idiom-hanja {
    font-size: 32px;
    font-weight: 700;
    color: #7f1d1d;
    margin-bottom: 4px;
    letter-spacing: 4px;
}

.tg-idiom-reading {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.tg-idiom-meaning {
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.tg-idiom-example {
    font-size: 14px;
    color: #888;
    font-style: italic;
    padding: 10px 14px;
    background: #fef2f2;
    border-radius: 8px;
}

/* Idiom Today */
.tg-idiom-today {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.tg-idiom-today .tg-idiom-hanja {
    color: #fecaca;
    font-size: 40px;
}

.tg-idiom-today .tg-idiom-reading {
    color: #fff;
    font-size: 24px;
}

.tg-idiom-today .tg-idiom-meaning {
    color: #fecaca;
    font-size: 16px;
}

.tg-idiom-today .tg-idiom-example {
    background: rgba(255,255,255,0.15);
    color: #fecaca;
}

.tg-idiom-list {
    max-height: none;
}

.tg-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* Next button */
.tg-next-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
}

/* Animations */
@keyframes tg-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tg-fadeInUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.tg-fade-in {
    animation: tg-fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 600px) {
    .tg-edu-wrap {
        padding: 12px;
    }

    .tg-edu-header h2 {
        font-size: 22px;
    }

    .tg-question-sentence {
        font-size: 17px;
    }

    .tg-option-btn {
        padding: 14px 16px;
        font-size: 15px;
    }

    .tg-options-two {
        grid-template-columns: 1fr;
    }

    .tg-result-score {
        font-size: 40px;
    }

    .tg-idiom-hanja {
        font-size: 26px;
    }

    .tg-idiom-tabs {
        gap: 6px;
    }

    .tg-tab-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .tg-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .tg-idiom-today .tg-idiom-hanja {
        font-size: 32px;
    }
}
