/* Results Panel — component styles.
   Tailwind handles the layout. This file covers two things Tailwind can't reach:
   the legacy classes the admin controllers still print into table rows
   (.btn, .form-control, …), and a few shared components used on every page. */

[x-cloak] { display: none !important; }

html { font-size: 15px; }

/* ---------- cards ---------- */

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .05);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #f0f2f5;
}

.card-title { font-size: 1.05rem; font-weight: 600; color: #111827; margin: 0; }
.card-body  { padding: 1.5rem; }

@media (max-width: 640px) {
    .card { border-radius: 12px; }
    .card-head, .card-body { padding: 1rem; }
}

/* ---------- buttons (view markup and controller markup alike) ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: .6rem 1.1rem;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, transform .05s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(5, 150, 105, .35); outline-offset: 2px; }

.btn-small, .btn-sm { padding: .4rem .8rem; font-size: .875rem; border-radius: 9px; }
.btn-md { padding: .6rem 1.1rem; }
.btn-block { width: 100%; }

.btn-primary, .btn-success { background: #059669; color: #fff; }
.btn-primary:hover, .btn-success:hover { background: #047857; color: #fff; }

.btn-default, .btn-outline-dark, .btn-light {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}
.btn-default:hover, .btn-outline-dark:hover, .btn-light:hover { background: #f3f4f6; color: #111827; }

.btn-danger  { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; color: #991b1b; }

.btn-warning { background: #fef3c7; color: #92400e; }
.btn-warning:hover { background: #fde68a; color: #78350f; }

.btn-dark { background: #111827; color: #fff; }
.btn-dark:hover { background: #1f2937; color: #fff; }

.btn-info { background: #1d4ed8; color: #fff; }
.btn-info:hover { background: #1e40af; color: #fff; }

/* The winner "Submit" button the prize controller prints */
.bg-purple.btn, .btn.bg-purple { background: #6d28d9 !important; border-color: #6d28d9; color: #fff !important; }
.bg-purple.btn:hover { background: #5b21b6 !important; }

/* ---------- inputs ---------- */

.form-control, .input {
    display: block;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    padding: .6rem .9rem;
    font-size: .95rem;
    color: #111827;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, .15);
}

.form-control::placeholder, .input::placeholder { color: #9ca3af; }

select.form-control, select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right .75rem center;
    background-repeat: no-repeat;
    background-size: 1.4em;
    padding-right: 2.75rem;
}

/* inputs the controllers inject into table cells */
td .form-control { min-width: 12rem; margin-bottom: .5rem; }

label { font-weight: 500; color: #374151; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

.data-table thead th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .75rem 1.1rem;
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    border-bottom: 1px solid #f0f2f5;
    padding: .8rem 1.1rem;
    vertical-align: middle;
    font-size: .95rem;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9fafb; }

.data-table td .btn + .btn, .data-table td a + a { margin-left: .4rem; }

/* comma-separated winner runs wrap; keep the digits aligned */
.data-table td { word-break: break-word; }

@media (max-width: 640px) {
    .data-table thead th, .data-table tbody td { padding: .8rem .9rem; font-size: 1rem; }
    .data-table td .btn { margin-bottom: .35rem; }
}

/* ---------- auto-import console ---------- */

#console {
    background: #111827;
    border-radius: 12px;
    color: #6ee7b7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.6;
    padding: 1rem 1.2rem;
    height: 260px;
    overflow: auto;
    white-space: pre-wrap;
}

/* ---------- pills ---------- */

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .85rem;
    font-weight: 600;
}
.pill-ok   { background: #d1fae5; color: #065f46; }
.pill-info { background: #dbeafe; color: #1e40af; }
.pill-muted{ background: #f3f4f6; color: #4b5563; }

/* ---------- progress bar ---------- */

#nprogress .bar { background: #059669; height: 3px; }
#nprogress .peg { box-shadow: 0 0 10px #059669, 0 0 5px #059669; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
