/* === Base site styles (from your existing theme) === */
/* (Kept intact; extended below for the Calendar UI) */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #111;
    background-image: linear-gradient(to bottom, rgba(17,17,17,0.7), #111), url('/images/banner.png'), radial-gradient(#333 1px, transparent 1px);
    background-size: 100% auto, 100% auto, 20px 20px;
    background-repeat: no-repeat, no-repeat, repeat;
    background-position: top center, top center, top left;
    color: #fff;
    overflow-x: hidden;
}

header.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    position: relative;
    flex-wrap: wrap;
}

.header-text { flex-grow: 1; }

h1 {
    font-family: 'Anton', sans-serif;
    font-size: clamp(2rem, 3vw + 1rem, 3rem);
    color: #00ffcc;
    margin: 0;
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    margin-top: 0.25rem;
    color: #bffcf0;
}

/* Buttons */
.button {
    padding: 0.75rem 1.1rem;
    background-color: #00ffcc;
    color: #000;
    text-decoration: none;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform .15s ease, background .3s ease, box-shadow .3s ease;
    box-shadow: 0 8px 20px rgba(0,255,204,.15);
}
.button:hover { background-color: #00ccaa; transform: translateY(-1px); }
.button.subtle {
    background: rgba(0,255,204,0.1);
    color: #00ffcc;
    box-shadow: none;
    border: 1px solid rgba(0,255,204,0.25);
}
.button.subtle:hover { background: rgba(0,255,204,0.2); }
.button.danger {
    background: linear-gradient(135deg, #ff6b8f, #ff3f72);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 63, 114, 0.28);
}
.button.danger:hover {
    background: linear-gradient(135deg, #ff7a9a, #ff4e7d);
}

.hidden { display: none !important; }
.muted { color: #9adfd0; }
.muted.tiny { font-size: .85rem; }

/* Layout */
.container {
    max-width: 1100px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card-title {
    color: #00ffcc;
    margin: 0 0 .5rem 0;
    font-size: 1.3rem;
}

/* Forms */
.grid { display: grid; }
.grid.gap { gap: .9rem; }
.grid.two { grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 640px){ .grid.two { grid-template-columns: 1fr; } }

.field .label { display:block; margin: 0 0 .3rem; color: #bffcf0; font-size: .95rem; }
input, select {
    padding: .75rem .8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.45);
    color: #fff;
    width: 100%;
    outline: none;
}
input:focus, select:focus { border-color: #00ffcc; box-shadow: 0 0 0 2px rgba(0,255,204,.15); }
.error { color: #ff8aa6; }

/* Header actions */
.header-actions { display: flex; gap: .6rem; align-items: center; }

/* Auth card tweaks */
.auth-card { max-width: 480px; margin: 2rem auto; }

/* Loading overlay */
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: grid; place-items: center;
    z-index: 50;
}
.loading-card {
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(0,255,204,0.2);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    display: grid; place-items: center; gap: .8rem;
}
.spinner {
    width: 42px; height: 42px; border-radius: 50%;
    border: 4px solid rgba(0,255,204,0.25);
    border-top-color: #00ffcc; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #bffcf0; }

/* Controls row */
.controls {
    display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
    margin: 1rem 0;
}
.date-controls { display: flex; gap: .5rem; align-items: center; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: .6rem; }
.legend-item {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .3rem .55rem; border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    font-size: .9rem;
}
.legend-item .swatch {
    width: 14px; height: 14px; border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,.3) inset;
}

/* Timeline */
.timeline-wrap {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    margin-bottom: 1rem;
}
.timeline {
    position: relative;
    display: grid;
    grid-template-columns: 70px 1fr;
}
.hours-col {
    display: grid;
    grid-auto-rows: minmax(22px, 1fr);
    padding: 8px 0;
}
.hour-label {
    font-size: .85rem;
    color: #9adfd0;
    text-align: right;
    padding: 6px 10px 6px 6px;
}
.grid-col {
    position: relative;
    display: grid;
    grid-template-rows: repeat(48, 26px); /* 30 min rows */
    gap: 0;
}
.slot {
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.slot:nth-child(2n) {
    background: rgba(0,0,0,0.15);
}
.event-layer {
    position: absolute;
    inset: 8px 8px 8px 8px;
    /* align rows with .grid-col via CSS grid */
    display: grid;
    grid-template-rows: repeat(48, 26px);
    grid-auto-columns: 1fr;
    pointer-events: auto;
}

.event-block {
    --col: #41b7e2;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "meta title";
    gap: .6rem;
    align-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #fff;
    padding: .55rem .7rem .55rem .55rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
}
.event-block::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    background: var(--col);
}
.event-block .meta-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--col);
    box-shadow: 0 0 0 2px rgba(0,0,0,.35) inset;
}
.event-block-time { font-weight: 700; font-variant-numeric: tabular-nums; color: #bffcf0; }
.event-block-name { font-weight: 700; font-size: 1rem; }
.event-block-location { font-weight: 400; font-style: italic; color: #d0efe8; opacity: .85; }


/* Event list */
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.event-item {
    display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center;
    padding: .6rem .7rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
}
.event-item .dot { width: 12px; height: 12px; border-radius: 50%; }
.event-item .meta .name { font-weight: 700; }
.event-item .meta .sub { color: #9adfd0; font-size: .9rem; }
.event-item .times { font-variant-numeric: tabular-nums; color: #bffcf0; }
.event-item-side {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
}
.event-actions {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.event-action-btn {
    border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
    color: #ebfffa;
    border-radius: 999px;
    padding: .38rem .78rem;
    min-height: 30px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    backdrop-filter: blur(8px);
    transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.event-action-btn:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
    border-color: rgba(255,255,255,0.34);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0,0,0,.28);
}
.event-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,255,204,.3), 0 12px 24px rgba(0,0,0,.28);
}
.event-action-btn.edit {
    color: #d7fff3;
}
.event-action-btn.delete {
    color: #ffe0e7;
    border-color: rgba(255, 99, 141, 0.5);
    background: linear-gradient(180deg, rgba(255, 105, 150, 0.38), rgba(255, 65, 120, 0.22));
}
.event-action-btn.delete:hover {
    background: linear-gradient(180deg, rgba(255, 122, 162, 0.48), rgba(255, 75, 126, 0.28));
    border-color: rgba(255, 140, 172, 0.75);
}

/* Modal */
.modal {
    border: none; padding: 0; background: transparent;
}
.modal::backdrop { background: rgba(0,0,0,.6); }
.modal-card {
    background: rgba(10, 14, 12, 0.92);
    border: 1px solid rgba(0,255,204,0.2);
    border-radius: 16px;
    width: min(560px, 92vw);
    padding: 1rem;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: 1rem;
}
.icon-btn {
    background: transparent; border: none; color: #bffcf0; cursor: pointer; font-size: 1.1rem;
}
.color-preview-row { display: flex; align-items: center; gap: .6rem; }
.color-pill {
    width: 22px; height: 22px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 0 2px rgba(0,0,0,.35) inset;
}

/* Footer */
footer { text-align: center; font-size: 0.9rem; color: #aaa; padding: 1rem; margin-top: 2rem; }

/* Small screens */
@media (max-width: 480px) {
    .hours-col { grid-auto-rows: minmax(26px, 1fr); }
    .grid-col { grid-template-rows: repeat(48, 30px); }
    .event-block { padding: .35rem .5rem; font-size: .95rem; }
}


/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: .6rem;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0,255,204,0.25);
    background: rgba(0,255,204,0.08);
    color: #00ffcc;
    font-weight: 900;
    text-decoration: none;
    transition: transform .15s ease, background .25s ease;
}
.back-btn:hover { background: rgba(0,255,204,0.16); transform: translateY(-1px); }
.header-text { display:flex; align-items:center; gap:.6rem; }


.event-item:hover { border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,0.04); }
.event-block:hover { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); }

/* Modal readability fixes */
.modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.label {               /* covers non-field labels, like the Color pill row */
    color: #bffcf0;
}

.color-preview-row .label {
    /* ensure the Color label is readable even if .label is overridden elsewhere */
    color: #bffcf0;
}

.confirm-card {
    width: min(460px, 92vw);
    padding: 1.15rem;
    box-shadow: 0 18px 48px rgba(0,0,0,.45);
}
.confirm-card p {
    margin: .35rem 0 .25rem;
    line-height: 1.5;
}
.confirm-footer {
    justify-content: space-between;
}

.toast-stack {
    position: fixed !important;
    left: 1rem;
    bottom: 1rem;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    width: min(360px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}
.toast {
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: opacity .22s ease, transform .22s ease;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(10, 16, 14, 0.95);
    color: #f0fffb;
    padding: .78rem .95rem;
    box-shadow: 0 18px 40px rgba(0,0,0,.4);
    font-weight: 600;
    width: 100%;
    backdrop-filter: blur(10px);
}
.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.toast.success {
    border-left: 4px solid rgba(0,255,204,0.9);
}
.toast.error {
    border-left: 4px solid rgba(255, 99, 141, 0.95);
}

