/* Sains Ceria Quiz System Styles - Pastel Bliss Theme */

/* Base Quiz Container */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* Start Screen */
.start-screen {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.start-btn {
    background: linear-gradient(135deg, #ffb5a7 0%, #fec89a 100%);
    color: white;
    padding: 1rem 3rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 181, 167, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 181, 167, 0.5);
}

/* Timer */
.timer-display {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #c97b63;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #ffb5a7;
    z-index: 100;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background: #fcd5ce;
    border-radius: 9999px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffb5a7, #fec89a);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* Stabilize Navigation */
.question-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #fcd5ce;
    animation: slideIn 0.4s ease;
    /* HCI Fix: Min height to prevent buttons from jumping */
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Push content up so if it's short, it stays top, but card remains tall */
.question-content-wrapper {
    flex-grow: 1;
}

/* New Premium Summary Styles */
.summary-header {
    font-size: 2.5rem;
    font-weight: 800;
    color: #c97b63;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 0px rgba(255, 181, 167, 0.2);
}

.summary-info-box {
    background: linear-gradient(135deg, #f8edeb 0%, #fcd5ce 100%);
    border: 2px solid #ffb5a7;
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-item {
    text-align: center;
    flex: 1;
}

.info-divider {
    width: 2px;
    height: 40px;
    background: #ffb5a7;
    margin: 0 1rem;
}

.info-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.score-circle-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 3rem;
}

.score-circle-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 25px -5px rgba(255, 181, 167, 0.25);
    border: 8px solid #f8edeb;
}

/* Gradient Ring */
.score-circle-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, #ffb5a7, #fec89a);
    z-index: 1;
}

.score-circle-sub {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffb5a7;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.score-circle-value {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    color: #c97b63;
    padding-bottom: 0.5rem;
}

.score-circle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.25rem 1rem;
    background: #fcd5ce;
    border-radius: 9999px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border: 1px solid #fcd5ce;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: currentColor;
}

.stat-card.correct {
    color: #22c55e;
}

.stat-card.wrong {
    color: #f59e0b;
}

.stat-card.accuracy {
    color: #ffb5a7;
}

.stat-card.average {
    color: #c97b63;
}

.stat-card.correct .stat-icon {
    background: #22c55e;
}

.stat-card.wrong .stat-icon {
    background: #f59e0b;
}

.stat-card.accuracy .stat-icon {
    background: #ffb5a7;
}

.stat-card.average .stat-icon {
    background: #c97b63;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0.9;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.retry-btn-mini {
    background: #fcd5ce;
    color: #c97b63;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.retry-btn-mini:hover {
    background: #ffb5a7;
    color: white;
}

.dashboard-btn {
    background: #c97b63;
    color: white;
    padding: 1rem 3rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(201, 123, 99, 0.3);
}

.dashboard-btn:hover {
    background: #a85d47;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 123, 99, 0.4);
}

.question-number {
    font-size: 0.875rem;
    color: #ffb5a7;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #c97b63;
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* MCQ Options */
.options-grid {
    display: grid;
    gap: 1rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8edeb;
    border: 2px solid #fcd5ce;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover:not(.disabled) {
    border-color: #ffb5a7;
    background: #fcd5ce;
    transform: translateX(5px);
}

.option-btn.selected {
    border-color: #fec89a;
    background: #f9dcc4;
}

.option-btn.correct {
    border-color: #22c55e;
    background: #dcfce7;
    animation: pulse-correct 0.5s ease;
}

.option-btn.incorrect {
    border-color: #f59e0b;
    background: #fef3c7;
    animation: shake 0.5s ease;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-label {
    width: 2.5rem;
    height: 2.5rem;
    background: #fcd5ce;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #c97b63;
    flex-shrink: 0;
}

.option-btn.correct .option-label {
    background: #22c55e;
    color: white;
}

.option-btn.incorrect .option-label {
    background: #f59e0b;
    color: white;
}

@keyframes pulse-correct {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Dropdown Question */
.dropdown-container {
    margin-top: 1rem;
}

.quiz-dropdown {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #fcd5ce;
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-dropdown:focus {
    outline: none;
    border-color: #ffb5a7;
}

.quiz-dropdown.correct {
    border-color: #22c55e;
    background: #dcfce7;
}

.quiz-dropdown.incorrect {
    border-color: #f59e0b;
    background: #fef3c7;
}

/* Drag and Drop */
.drag-drop-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drag-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8edeb;
    border-radius: 1rem;
    min-height: 60px;
}

.drag-item {
    padding: 0.75rem 1.25rem;
    background: white;
    border: 2px solid #ffb5a7;
    border-radius: 0.5rem;
    cursor: grab;
    font-weight: 500;
    transition: all 0.2s ease;
}

.drag-item:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.drag-item.dragging {
    opacity: 0.5;
}

.drop-zone {
    min-height: 80px;
    border: 2px dashed #fcd5ce;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #ffb5a7;
    background: #fcd5ce;
}

.drop-zone.correct {
    border-color: #22c55e;
    background: #dcfce7;
    border-style: solid;
}

.drop-zone.incorrect {
    border-color: #f59e0b;
    background: #fef3c7;
    border-style: solid;
}

/* Matching Question */
.matching-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    position: relative;
}

.matching-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-item {
    padding: 1rem;
    background: #f8edeb;
    border: 2px solid #fcd5ce;
    border-radius: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.match-item:hover {
    border-color: #ffb5a7;
}

.match-item.selected {
    border-color: #fec89a;
    background: #f9dcc4;
}

.match-item.matched {
    border-color: #22c55e;
    background: #dcfce7;
}

.match-item.incorrect {
    border-color: #f59e0b;
    background: #fef3c7;
}

/* SVG Lines for matching */
.lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.match-line {
    stroke: #ffb5a7;
    stroke-width: 3;
    fill: none;
}

.match-line.correct {
    stroke: #22c55e;
}

.match-line.incorrect {
    stroke: #f59e0b;
}

/* Main Horizontal Layout */
.quiz-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 1rem;
}

.quiz-center {
    flex: 1;
    max-width: 800px;
    position: relative;
}

.nav-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    position: sticky;
    top: 50vh;
    transform: translateY(-50%);
    z-index: 20;
    height: fit-content;
}

.nav-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.nav-btn.prev {
    background: white;
    color: #c97b63;
    border: 2px solid #fcd5ce;
}

.nav-btn.prev:hover:not(:disabled) {
    border-color: #ffb5a7;
    color: #a85d47;
    transform: translateX(-3px);
}

.nav-btn.next {
    background: #c97b63;
    color: white;
}

.nav-btn.next:hover {
    background: #a85d47;
    transform: translateX(3px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem 4rem;
    border-radius: 1rem;
    font-size: 2rem;
    font-weight: 700;
    z-index: 1000;
    animation: popIn 0.4s ease;
}

.feedback-overlay.correct {
    background: #22c55e;
    box-shadow: 0 10px 40px -5px rgba(34, 197, 94, 0.4);
}

.feedback-overlay.incorrect {
    background: #f59e0b;
    box-shadow: 0 10px 40px -5px rgba(245, 158, 11, 0.4);
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Summary Screen */
.summary-screen {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.summary-card {
    background: white;
    border-radius: 2.5rem;
    padding: 3rem;
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
    border: 2px solid #fcd5ce;
    text-align: center;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .summary-card,
    .summary-card * {
        visibility: visible;
    }

    .summary-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .action-buttons {
        display: none !important;
    }

    .bg-\[\#f8edeb\] {
        background: white !important;
    }
}

.summary-score {
    font-size: 5rem;
    font-weight: 800;
    color: #c97b63;
    line-height: 1;
}

.summary-score span {
    font-size: 2rem;
    color: #64748b;
}

.summary-time {
    font-size: 1.25rem;
    color: #64748b;
    margin: 1rem 0 2rem;
}

.summary-breakdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.breakdown-item {
    text-align: center;
}

.breakdown-number {
    font-size: 2rem;
    font-weight: 700;
}

.breakdown-label {
    font-size: 0.875rem;
    color: #64748b;
}

.retry-btn {
    background: linear-gradient(135deg, #ffb5a7 0%, #fec89a 100%);
    color: white;
    padding: 1rem 4rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 181, 167, 0.4);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 181, 167, 0.5);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-side {
        position: static;
        transform: none;
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }

    .nav-side.left {
        order: 2;
    }

    .nav-side.right {
        order: 3;
    }

    .quiz-center {
        order: 1;
    }

    .nav-btn {
        width: 56px;
        height: 56px;
    }

    .question-card {
        min-height: auto;
        padding: 1.5rem;
    }

    .timer-display {
        top: 80px;
        right: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 2rem 1.5rem;
    }

    .matching-container {
        flex-direction: column;
        gap: 2rem;
    }
}
/* Label Diagram Styles */
.label-diagram-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.diagram-area {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
}

.diagram-drop-zone {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #fcd5ce;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #c97b63;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 10;
}

.diagram-drop-zone.drag-over {
    background: #fcd5ce;
    border-color: #ffb5a7;
    transform: scale(1.05);
    z-index: 20;
}

.diagram-drop-zone.filled {
    border-style: solid;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-color: #ffb5a7;
}

.diagram-drop-zone.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.diagram-drop-zone.incorrect {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    border-style: solid;
    animation: shake 0.5s ease;
}

.diagram-drop-zone .placeholder {
    opacity: 0.4;
    font-size: 1.2rem;
}

.drag-items-pool {
    min-height: 60px;
    padding: 1rem;
    background: #fff5f2;
    border-radius: 1rem;
    width: 100%;
    border: 1px dashed #fcd5ce;
}
