/* ==========================================================================
   ICAN Admin — Shared Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Baskervville:ital,wght@0,400..700;1,400..700&display=swap');

@font-face {
    font-family: 'Circular-web';
    src: url('../fonts/CircularXXWeb-Medium.woff2') format('woff2'),
        url('../fonts/CircularXXWeb-Medium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --bg: #fefefe;
    --surface: #eee;
    --surface2: #eee;
    --border: #1e232e;
    --accent: #ffde1c;
    --accent2: #4e3366;
    --danger: #ef4444;
    --success: #22c55e;
    --text: #000001;
    --muted: #6b7280;
    --orange: #e85224;

    --radius-sm: 4px;
    --radius: 8px;
    --max-width: 860px;
    --form-width: 600px;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    /* font-family: 'DM Mono', monospace; */
    font-family: 'Circular-web', sans-serif;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* Grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.container--narrow {
    max-width: var(--form-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.container--xs {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Centered full-page layout (login) */
.page-center {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.remember input {
    width: auto;
}

.remember label {
    margin: 0;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.topnav-links {
    display: flex;
    gap: 1.5rem;
}

.topnav a {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--border);
    transition: color 0.2s;
}

.topnav a:hover {
    color: var(--text);
}

.topnav a.active {
    color: var(--text);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 2px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb span {
    color: var(--border);
}

/* Day picker */
.day-picker {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.day-btn {
    padding: 0.35rem 0.75rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.2s;
}

.day-btn:hover {
    color: var(--text);
    border-color: var(--muted);
}

.day-btn.active {
    background: var(--accent);
    color: #0d0f14;
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

header {
    margin-bottom: 2rem;
}

.label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

h1 {
    font-family: 'Baskervville', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
}

header h1 {
    margin-bottom: 1rem;
}

h1 em {
    font-style: italic;
    color: var(--accent);
}

.meta {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.meta .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent2);
    animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Alerts / Flash Messages
   -------------------------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(232, 197, 71, 0.08);
    border: 1px solid rgba(232, 197, 71, 0.25);
    color: var(--accent);
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #0d0f14;
}

.btn-primary:hover {
    background: #f0d060;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--muted);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
}

.btn-disabled {
    background: transparent;
    color: var(--border);
    border: 1px solid var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-sm {
    padding: 0.28rem 0.65rem;
    font-size: 0.65rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

input,
select,
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select option {
    background: var(--surface);
}

.hint {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

.error {
    font-size: 0.68rem;
    color: var(--danger);
    margin-top: 0.3rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    cursor: pointer;
}

/* Checkbox grid (day selector) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.checkbox-grid .checkbox-group label {
    font-size: 0.75rem;
    text-transform: capitalize;
}

/* Section divider inside forms */
.section-label {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* Password strength */
.strength-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 0.5rem;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    font-size: 0.62rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Card / Login Card
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
}
.card .login{
    padding-bottom: 1rem;
}
        .login-btn {
            width: 100%; padding: 0.75rem;
            background: var(--accent); color: #0d0f14;
            font-family: 'DM Mono', monospace; font-size: 0.75rem;
            letter-spacing: 0.1em; text-transform: uppercase;
            border: none; border-radius: 4px; cursor: pointer;
            transition: background 0.2s; margin-top: 0.5rem;
        }
        .login-btn:hover { background: #f0d060; }

/* --------------------------------------------------------------------------
   Stats Bar
   -------------------------------------------------------------------------- */
.stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    flex: 1;
}

.stat-value {
    font-family: 'Baskervville', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1em;
}

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

thead {
    border-bottom: 1px solid var(--border);
}

th {
    padding: 0.75rem 1.25rem;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    font-weight: 400;
}

tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    animation: fadeIn 0.3s ease both;
}

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

tr:hover {
    background: var(--surface2);
}

td {
    padding: 1rem 1.25rem;
    font-size: 0.82rem;
    vertical-align: middle;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-family: 'Baskervville', serif;
    color: var(--accent);
    flex-shrink: 0;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    border: 2px solid var(--border);
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.user-id {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.user-email {
    color: var(--muted);
    font-size: 0.78rem;
}

.user-joined {
    color: var(--muted);
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

.badge-blue {
    color: var(--accent2);
    background: rgba(91, 140, 245, 0.1);
    border: 1px solid rgba(91, 140, 245, 0.3);
}

.badge-yellow {
    color: var(--accent);
    background: rgba(232, 197, 71, 0.1);
    border: 1px solid rgba(232, 197, 71, 0.3);
}

.badge-live::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.5s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Schedule — Timeslot List
   -------------------------------------------------------------------------- */
.schedule-list {
    display: flex;
    flex-direction: column;
}

.timeslot {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0 1.5rem;
    padding: 1.25rem 0 1.5rem;
    position: relative;
    transition: background 0.2s;
    animation: slideIn 0.4s ease both;
}

.timeslot.active {
    background: #eee;
    border-bottom-color: var(--accent2);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1rem;
    margin: 0 -1rem;
}

.timeslot.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent2);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.timeslot.past .time,
.timeslot.past .program-name {
    opacity: 0.4;
}

.timeslot .time {
    font-size: 0.75rem;
    color: var(--muted);
    padding-top: 0.2rem;
    letter-spacing: 0.05em;
}

.timeslot.active .time {
    color: var(--accent2);
}

.program-name {
    font-family: 'Baskervville', serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.program-name a {
    color: var(--text);
    text-decoration: none;
}

.program-name a:hover {
    color: var(--accent);
}

.program-subtitle,
.subtitle {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.program-description,
.description {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 55ch;
}

.slot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.slot-actions form {
    display: inline;
}


/* ==========================================================================
   Layout additions — append these to ican.css
   ========================================================================== */

/* ── Page wrap ── */
.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Radial background (now-playing style, subtle on other pages) ── */
.radio-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--bg);
    overflow: hidden;
}

.radio-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 60%, rgba(91, 140, 245, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 30%, rgba(232, 197, 71, 0.04) 0%, transparent 55%);
}

.radio-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ── Topnav updates ── */
.topnav {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.site-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topnav-user {
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Danger Zone
   -------------------------------------------------------------------------- */
.danger-zone {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.03);
}

.danger-zone h3 {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.danger-zone p {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--muted);
}

.empty p {
    font-family: 'Baskervville', serif;
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.page-footer {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.68rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-footer a {
    color: var(--muted);
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes pulse {

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

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered row animations */
tr:nth-child(1),
.timeslot:nth-child(1) {
    animation-delay: 0.05s;
}

tr:nth-child(2),
.timeslot:nth-child(2) {
    animation-delay: 0.10s;
}

tr:nth-child(3),
.timeslot:nth-child(3) {
    animation-delay: 0.15s;
}

tr:nth-child(4),
.timeslot:nth-child(4) {
    animation-delay: 0.20s;
}

tr:nth-child(5),
.timeslot:nth-child(5) {
    animation-delay: 0.25s;
}

tr:nth-child(6),
.timeslot:nth-child(6) {
    animation-delay: 0.30s;
}

tr:nth-child(7),
.timeslot:nth-child(7) {
    animation-delay: 0.35s;
}

tr:nth-child(8),
.timeslot:nth-child(8) {
    animation-delay: 0.40s;
}

tr:nth-child(9),
.timeslot:nth-child(9) {
    animation-delay: 0.45s;
}

tr:nth-child(10),
.timeslot:nth-child(10) {
    animation-delay: 0.50s;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .topnav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    th:nth-child(3) {
        display: none;
    }

    td:nth-child(3) {
        display: none;
    }
}

/* ── Responsive nav ── */
@media (max-width: 600px) {
    .topnav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .topnav-links {
        order: 3;
        width: 100%;
        gap: 1rem;
    }

    .topnav-right {
        margin-left: auto;
    }

    .topnav-user {
        display: none;
    }
}