@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

:root {
    --red: #ce1126;
    --red-dark: #a00d1d;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
    padding: 3rem 1rem 6rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--gray-50);
    transform: skewY(-2deg);
    z-index: 1;
}

.header-simple::after {
    display: none;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.header h2 {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.theme-badge {
    display: inline-block;
    background-color: var(--white);
    color: var(--red);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .sticky-desktop {
        position: static !important;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--red);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 1.25rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Participant Displays */
.participant-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.participant-order {
    display: inline-block;
    margin-top: 1rem;
    background: var(--red);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.table-container {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-header {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    font-weight: 500;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--gray-50);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-menunggu {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.badge-tampil {
    background-color: var(--red);
    color: var(--white);
    animation: pulse 2s infinite;
}

.badge-selesai {
    background-color: #10b981;
    color: var(--white);
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(206, 17, 38, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(206, 17, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(206, 17, 38, 0); }
}

/* Admin & Juri Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(206, 17, 38, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--red);
    color: var(--white);
}

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

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-success {
    background-color: #10b981;
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.flex {
    display: flex;
}
.justify-between {
    justify-content: space-between;
}
.items-center {
    align-items: center;
}
.gap-2 {
    gap: 0.5rem;
}

/* Score Display */
.score-badge {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--red);
}

/* Score Popup Animation */
.score-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.score-popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.score-popup-content {
    background: var(--white);
    padding: 4rem;
    border-radius: 1rem;
    text-align: center;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-top: 8px solid var(--red);
}

.score-popup-overlay.active .score-popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.popup-title {
    font-size: 1.5rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    font-weight: 700;
}

.popup-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 2rem;
}

.popup-score-container {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px dashed var(--red);
}

.popup-score-label {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 600;
}

.popup-score {
    font-size: 6rem;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    text-shadow: 2px 2px 0px rgba(206, 17, 38, 0.1);
}

/* Fireworks placeholder (optional if we add js canvas fireworks later) */
#fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}
