/**
 * Modern UI CSS - Angket Guru WIJABA
 * Optimized for Mobile & Desktop
 */

:root {
    --primary-green: #16a34a;
    --primary-green-dark: #15803d;
    --primary-green-light: #dcfce7;
    --accent-blue: #0284c7;
    --accent-blue-dark: #0369a1;
    --accent-blue-light: #e0f2fe;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border-subtle: #e2e8f0;
    --card-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.06), 0 0 1px 1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.public-body {
    background: radial-gradient(circle at 10% 10%, rgba(220, 252, 231, 0.45), transparent 35%),
                radial-gradient(circle at 90% 10%, rgba(224, 242, 254, 0.45), transparent 35%),
                var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.main-content {
    flex: 1 0 auto;
    padding-bottom: 2.5rem;
}

/* Container & Paper */
.survey-wrapper {
    max-width: 860px;
    margin: 1.75rem auto 3rem auto;
    padding: 0 1rem;
}

.survey-paper {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-subtle);
    padding: 2.75rem 2.25rem;
    position: relative;
    overflow: hidden;
}

.survey-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #16a34a 0%, #0284c7 50%, #10b981 100%);
}

@media (max-width: 768px) {
    .survey-wrapper {
        margin: 0.75rem auto 2rem auto;
        padding: 0 0.5rem;
    }
    .survey-paper {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
}

/* Header Logos Container */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.header-logos .logo-item {
    max-height: 55px;
    max-width: 180px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.03));
}

@media (max-width: 576px) {
    .header-logos {
        gap: 1.25rem;
        padding-bottom: 1.25rem;
        margin-bottom: 1.25rem;
    }
    .header-logos .logo-item {
        max-height: 42px;
        max-width: 130px;
    }
}

/* Titles & Badges */
.program-title {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.35rem;
    text-align: center;
    line-height: 1.38;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.program-badge {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.4rem 1.35rem;
    border-radius: 50px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.section-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .program-title {
        font-size: 1.15rem;
    }
    .program-badge {
        font-size: 0.78rem;
        padding: 0.35rem 1.1rem;
    }
    .section-title {
        font-size: 1rem;
    }
}

/* Floating Live Progress Header */
.floating-progress-bar {
    position: sticky;
    top: 0.75rem;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 50px;
    padding: 0.55rem 1.15rem;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.floating-progress-bar .progress-track {
    flex-grow: 1;
    height: 7px;
    background-color: #f1f5f9;
    border-radius: 50px;
    overflow: hidden;
}

.floating-progress-bar .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a, #10b981);
    border-radius: 50px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-progress-bar .progress-counter {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-green-dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 576px) {
    .floating-progress-bar {
        padding: 0.45rem 0.9rem;
        top: 0.5rem;
        margin-bottom: 0.75rem;
    }
    .floating-progress-bar .progress-counter {
        font-size: 0.75rem;
    }
}

/* Biodata Card */
.biodata-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.35rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.biodata-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-green-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
}

.form-label-custom {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.input-custom {
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    padding: 0.6rem 0.85rem;
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-custom:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    outline: none;
}

.input-locked {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
    font-weight: 600;
    cursor: not-allowed;
}

.realtime-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    margin-top: 0.35rem;
}

/* Instructions Box */
.instructions-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-green);
    border-radius: 10px;
    padding: 1.15rem;
    margin-bottom: 1.75rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #475569;
}

.instructions-box h6 {
    font-weight: 700;
    color: var(--primary-green-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ========================================================
   QUESTION CARDS & MOBILE-OPTIMIZED SCALE RATING
   ======================================================== */
.question-card {
    background: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.question-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--hover-shadow);
}

.question-card.is-answered {
    border-color: #86efac;
    background: linear-gradient(180deg, #ffffff 0%, #fafffb 100%);
}

.question-card.is-answered::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: var(--primary-green);
    border-radius: 0 4px 4px 0;
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.question-badge-num {
    width: 30px;
    height: 30px;
    background: var(--primary-green-light);
    color: var(--primary-green-dark);
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.question-card.is-answered .question-badge-num {
    background: var(--primary-green);
    color: #ffffff;
}

.question-text {
    font-weight: 600;
    font-size: 0.96rem;
    color: #1e293b;
    line-height: 1.5;
    flex-grow: 1;
}

/* Unified Rating Block */
.scale-rating-wrapper {
    margin-top: 0.5rem;
}

/* Guide Header */
.scale-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.55rem;
    gap: 0.5rem;
}

.guide-badge-min {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.guide-badge-max {
    font-size: 0.75rem;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* 1-10 Buttons: 2 Tingkat (1-5 di atas, 6-10 di bawah) */
.scale-track {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
}

.scale-pill-label {
    position: relative;
    cursor: pointer;
    margin: 0;
    user-select: none;
    display: block;
}

.scale-pill-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scale-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    text-align: center;
}

.scale-pill-label:hover .scale-pill-btn {
    border-color: var(--primary-green);
    background-color: #f0fdf4;
    color: var(--primary-green-dark);
    transform: translateY(-2px);
}

.scale-pill-label input[type="radio"]:checked + .scale-pill-btn {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.4);
    transform: translateY(-2px) scale(1.04);
}

/* Feedback pill when selected */
.scale-selected-feedback {
    margin-top: 0.5rem;
    text-align: center;
}

.feedback-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    animation: fadeInScale 0.2s ease-in-out;
}

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

/* Mobile Adjustments for Scale Matrix */
@media (max-width: 576px) {
    .question-card {
        padding: 1.1rem 0.9rem;
        border-radius: 12px;
    }
    .question-header {
        gap: 0.6rem;
    }
    .question-badge-num {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    .question-text {
        font-size: 0.9rem;
    }

    .scale-guide-header {
        font-size: 0.7rem;
        margin-bottom: 0.45rem;
    }
    .guide-badge-min, .guide-badge-max {
        font-size: 0.68rem;
        padding: 0.15rem 0.45rem;
    }

    /* 2 Tingkat (1-5 & 6-10) di Mobile */
    .scale-track {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    .scale-pill-btn {
        height: 42px;
        font-size: 0.98rem;
        border-radius: 8px;
        border-width: 1.5px;
    }
}

@media (max-width: 360px) {
    .scale-track {
        gap: 4px;
    }
    .scale-pill-btn {
        height: 38px;
        font-size: 0.9rem;
        border-radius: 7px;
    }
}

/* Essay Textarea */
.textarea-custom {
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    padding: 0.75rem 0.9rem;
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.2s ease;
    resize: vertical;
    width: 100%;
}

.textarea-custom:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    outline: none;
}

/* Submit Area */
.submit-container {
    text-align: center;
    padding-top: 1.75rem;
    margin-top: 1.75rem;
    border-top: 1px solid #f1f5f9;
}

.btn-submit-survey {
    background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    padding: 0.85rem 2.75rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-submit-survey:hover {
    background: linear-gradient(135deg, #15803d 0%, #047857 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.4);
    transform: translateY(-2px);
}

.btn-submit-survey:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .btn-submit-survey {
        width: 100%;
        padding: 0.85rem 1.5rem;
        font-size: 0.98rem;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid #f1f5f9;
    background: transparent;
}
