:root {
    --primary: #dfa83d;
    --primary-hover: #b8860b;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.2);
    --text-main: #f5f5f5;
    --text-muted: #aaaaaa;
    --judge-accent: #9f1239;
    --judge-accent-hover: #be123c;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at 15% 50%, rgba(223, 168, 61, 0.12), transparent 22%),
                radial-gradient(circle at 85% 25%, rgba(159, 18, 57, 0.12), transparent 20%),
                linear-gradient(180deg, #090b14 0%, #090b14 45%, #121b33 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 40px 20px;
}

/* Result Page Body */
body.result-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-bar {
    max-width: 900px;
    margin: 0 auto 30px auto;
    display: flex;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-btn:hover { 
    color: var(--primary); 
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 28px;
    padding: 42px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 80px -30px rgba(0,0,0,0.7);
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    gap: 18px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

input[type="text"],
textarea {
    flex: 1;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(223, 168, 61, 0.1);
}

.question {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    padding: 26px;
    margin-bottom: 22px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.24s, border-color 0.28s, background 0.28s;
}

.question:hover {
    border-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.question p {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #eaeaea;
}

/* Radio Buttons */
label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

label:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(223, 168, 61, 0.3);
}

input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    outline: none;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

input[type="radio"]:checked {
    border-color: var(--primary);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: #aaa;
    border-color: #444;
}

.btn-secondary:hover {
    background: #444;
    color: #fff;
    border-color: #444;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    font-weight: 800;
    border-radius: 12px;
    font-size: 1.2rem;
    margin-top: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(223, 168, 61, 0.3);
}

.submit-btn.judge-btn {
    background: linear-gradient(135deg, var(--judge-accent), var(--judge-accent-hover));
}

.submit-btn.judge-btn:hover {
    box-shadow: 0 10px 20px rgba(159, 18, 57, 0.4);
}

/* Judge Specific */
.case-container {
    background: rgba(159, 18, 57, 0.05);
    border-left: 4px solid var(--judge-accent);
    padding: 25px;
    border-radius: 0 16px 16px 0;
    margin-bottom: 40px;
}

.case-container h2 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.statement {
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}
.statement:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.statement strong { color: var(--primary); }

/* Result Page Specific */
.box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.icon { font-size: 3.5rem; margin-bottom: 20px; }
.box h1 { font-size: 2rem; margin-bottom: 20px; }
.detail { font-size: 1.2rem; margin-bottom: 10px; color: #cccccc; }
.detail strong { color: #ffffff; }

.status-box { margin-top: 30px; padding: 20px; border-radius: 12px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); }
.status-title { font-size: 1.5rem; font-weight: 800; }
.status-passed { color: #10b981; }
.status-failed { color: #ef4444; }

.actions { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }

/* Law Links & Modal */
a.law-link { color: var(--primary); text-decoration: underline; text-decoration-style: dotted; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(5px); }
.modal-content { background: var(--bg-dark); border: 1px solid var(--card-border); border-radius: 16px; width: 90%; height: 85%; max-width: 1200px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; border-bottom: 1px solid var(--card-border); }
.modal-header h2 { font-size: 1.2rem; color: var(--primary); }
.modal-close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: color 0.3s; }
.modal-close-btn:hover { color: #fff; }
.modal-body { flex-grow: 1; }
.modal-body iframe { width: 100%; height: 100%; border: none; }

/* Responsive */
@media (max-width: 600px) {
    .input-group { flex-direction: column; }
    .container { padding: 25px; }
    .box { padding: 40px 25px; }
}

/* PDF download and print styles */
.download-pdf-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 25px;
}

.download-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
}

.download-pdf-btn:hover {
    background: rgba(223, 168, 61, 0.16);
    border-color: rgba(223, 168, 61, 0.35);
    color: #fff;
}

@media print {
    body, .container, .box, .case-container, .question, .statement, .intro-desc {
        background: #fff !important;
        color: #111 !important;
        box-shadow: none !important;
        border: none !important;
    }

    .container, .box {
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    body {
        background: #fff !important;
        padding: 0 !important;
    }

    a, button, .top-bar, .back-btn, .download-pdf-row, .btn, .modal-overlay {
        display: none !important;
    }

    textarea, input, label {
        color: #111 !important;
        border-color: #aaa !important;
        background: transparent !important;
    }
}

@media (max-width: 600px) {
    .input-group { flex-direction: column; }
    .container { padding: 25px; }
    .box { padding: 40px 25px; }
    .download-pdf-row { justify-content: center; }
}
