
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #667eea;
    --bg-color: #f5f7fa;
    --border-color: #e1e4e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 0.95rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    /*display: flex;*/
    flex-direction: column;
    align-items: center;
    padding: 80px 24px; /* Reduced from padding-top: 80px */
}

.app-header {
    text-align: center;
    margin-bottom: 40px;
}

    .app-header h1 {
        font-size: 2.5rem;
        color: var(--primary-color);
        margin-bottom: 10px;
    }

    .app-header p {
        color: #666;
        font-size: 1.1rem;
    }

.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 1000px; /* Increased from 900px for a more spacious feel on PC */
    padding: 24px 20px; /* Reduced from 40px 32px */
}

@media (max-width: 600px) {
    #iframePopupcontainer {
        max-width: 100%;
    }
}

#popbox3layer_contents_child {
    padding: 0px 24px;
}

#iframePopupcontainer {
    max-width: 700px;
}

    @media (max-width: 768px) {

        body {
            padding: 40px 12px;
        }

        .app-header {
            margin-bottom: 24px;
        }

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

        .card {
            padding: 16px 0px;
        }
        #popbox3layer_contents_child {
            padding: 0px 5px;
        }

        .meta {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        .tab-button {
            padding: 10px 12px;
            font-size: 0.85rem;
        }

        .section-card {
            padding: 12px;
        }

        .feedback-card {
            padding: 12px;
        }

        .issue-box {
            padding: 8px;
        }

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


        .stt-item {
            padding: 8px;
        }
    }

    .meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        font-size: 0.95rem;
        color: #555;
    }

    .badge {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 999px;
        background: #e0e7ff;
        color: #3730a3;
        font-size: 0.8rem;
        font-weight: 600;
    }

    pre {
        background: #0b1120;
        color: #e5e7eb;
        padding: 20px;
        border-radius: 8px;
        overflow-x: auto;
        font-size: 0.9rem;
        line-height: 1.5;
        max-height: 60vh;
    }

    /* °á°ú ·¹ÀÌ¾Æ¿ô (origine/templates/index.html ÂüÁ¶) */
    .result-section {
        margin-top: 10px;
    }

    .section-card {
        background: #f9fafb;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
    }

    .section-title {
        font-size: 1.1rem;
        color: var(--primary-color);
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e5e7eb;
        font-weight: 600;
    }

    .stt-item {
        padding: 10px 12px;
        margin-bottom: 6px;
        background: #ffffff;
        border-radius: 4px;
        border: 1px solid #e5e7eb;
        border-left: 3px solid var(--primary-color);
    }

    .stt-time {
        color: var(--primary-color);
        font-weight: 600;
        margin-bottom: 4px;
        font-size: 0.85rem;
    }

    .stt-text {
        color: #111827;
        line-height: 1.5;
        font-size: 0.95rem;
    }

    .tab-container {
        margin-top: 8px;
    }

    .tab-buttons {
        display: flex;
        gap: 10px;
        border-bottom: 2px solid #e5e7eb;
        margin-bottom: 16px;
    }

    .tab-button {
        padding: 10px 20px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-size: 0.95rem;
        color: #6b7280;
        transition: all 0.2s;
    }

        .tab-button:hover {
            color: var(--accent-color);
        }

        .tab-button.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
            font-weight: 600;
        }

    .tab-content {
        display: none;
    }

        .tab-content.active {
            display: block;
        }

    .feedback-card {
        background: #ffffff;
        border-radius: 6px;
        padding: 16px;
        margin-bottom: 14px;
        border: 1px solid #e5e7eb;
        border-left: 3px solid var(--primary-color);
    }

    .feedback-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .feedback-time {
        background: var(--primary-color);
        color: white;
        padding: 4px 10px;
        border-radius: 3px;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .feedback-number {
        color: #9ca3af;
        font-size: 0.8rem;
    }

    .issues-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 12px;
        margin-top: 8px;
    }

    .issue-box {
        background: #f9fafb;
        border-radius: 4px;
        padding: 12px;
        border: 1px solid #e5e7eb;
    }

        .issue-box.pronunciation {
            border-left: 3px solid #d97706;
        }

        .issue-box.grammar {
            margin:10px 0 0 0;
            border-left: 3px solid #dc2626;
        }

    .issue-box-title {
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 0.9rem;
    }

    .issue-detail {
        padding: 8px;
        background: #f3f4f6;
        border-radius: 4px;
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 6px;
    }

        .issue-detail:last-child {
            margin-bottom: 0;
        }

        .issue-std {
            margin-bottom: 6px;
            padding: 6px;
            background: #fef2f2;
            border-left: 3px solid #dc2626;
            border-radius: 4px;
        }

        .issue-edit {
            margin: 15px 0 6px 0;
            padding: 6px;
            background: #dcfce7;
            border-left: 3px solid #16a34a;
            border-radius: 4px;
        }

    .overall-feedback-box {
        background: #f9fafb;
        border-radius: 6px;
        padding: 20px;
        border: 1px solid #e5e7eb;
    }

    .feedback-summary {
        background: #ffffff;
        padding: 16px;
        border-radius: 4px;
        border-left: 3px solid var(--primary-color);
        line-height: 1.7;
        color: #111827;
        font-size: 0.95rem;
    }

    .error-box {
        background: #fee2e2;
        color: #991b1b;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #fecaca;
        margin-bottom: 20px;
        /*display: none;*/
    }

    .loading {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
    }

    .spinner {
        border: 4px solid #f3f3f3;
        border-top: 4px solid var(--primary-color);
        border-radius: 50%;
        width: 24px;
        height: 24px;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    /* »ó´Ü ÀÌµ¿ ¹öÆ° */
    .scroll-top-btn {
        position: fixed;
        right: 32px;
        bottom: 62px;
        padding: 10px 14px;
        border-radius: 999px;
        border: none;
        background: #34495e;
        color: #ffffff;
        font-size: 0.9rem;
        cursor: pointer;
        box-shadow: 0 10px 15px rgba(15, 23, 42, 0.25);
        display: none;
        z-index: 50;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .scroll-top-btn.show {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        opacity: 1;
        transform: translateY(0);
    }

    .scroll-top-btn.hide {
        opacity: 0;
        transform: translateY(8px);
    }

@media (max-width: 768px) {

    .section-card {
        padding: 20px 10px;
    }
    .issue-detail {
        padding: 8px 0px;
        background: #f3f4f6;
        border-radius: 4px;
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 6px;
    }
    .feedback-card {
        background: #ffffff;
        border-radius: 6px;
        padding: 16px 0px;
        margin-bottom: 14px;
        border: 1px solid #e5e7eb;
        /* border-left: 3px solid var(--primary-color); */
    }

    .feedback-number {
        margin-right:10px;
    }
    .feedback-time {
        margin-left: 10px;
    }
    .issue-box.pronunciation {
        border: 1px solid #e5e7eb;
    }

    .issue-box {
        padding: 12px 0px 0px 0px;
    }
    .issue-box.grammar {
        border: 1px solid #e5e7eb;
    }
    .issue-std {
        margin-bottom: 6px;
        padding: 6px;
        background: #fef2f2;
        border-left: 3px solid #dc2626;
        border-radius: 4px;
        border: 1px solid #e5e7eb;
    }
    .issue-edit {
        margin: 15px 0 6px 0;
        padding: 6px;
        background: #dcfce7;
        border-left: 3px solid #16a34a;
        border-radius: 4px;
        border: 1px solid #e5e7eb;
    }
}