@import url('https://fonts.bunny.net/css?family=space-mono:400,400i');

:root {
    --bg: #dddddd;
    --text: #222222;
    --text-rgb: 34, 34, 34;

    --green-rgb: 46, 204, 113;
    --yellow-rgb: 241, 196, 15;
    --orange-rgb: 230, 126, 34;
    --red-rgb: 231, 76, 60;

    --green: rgb(var(--green-rgb));
    --yellow: rgb(var(--yellow-rgb));
    --orange: rgb(var(--orange-rgb));
    --red: rgb(var(--red-rgb));

    --border-radius: 12px;
    --font-title: 1.3em;
    --font-body: 0.8em;
    --font-small: 0.8em;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Space Mono', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    font-size: var(--font-body);
}

.site-top-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.8em;
    width: 100%;
}

.site-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Global Typography */
h1,
.page-title {
    font-size: var(--font-title);
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2,
h3,
.section-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 1rem;
}

.small-text {
    font-size: var(--font-small);
    opacity: 0.8;
}

/* Typography styles */
h2 {
    font-size: 1em;
    margin-top: 0;
    margin-bottom: 2em;
    opacity: 0.8;
    font-weight: 400;
}

.description {
    font-size: 0.8em;
    line-height: 1.5;
    margin-top: auto;
    /* Push to bottom in flex container */
    max-width: 400px;
}

.uitleg {
    font-size: 0.6em;
    line-height: 1.5em;
    opacity: 0.7;
}

/* Layout */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.main-content {
    padding: 2em;
    flex: 1;
}

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

/* Card/Tile Styles */
.journey-card {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: default;
    color: var(--text);
    transition: background-color 0.2s ease;
}

.journey-card:hover {
    box-shadow: none;
}

.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stat-item,
span.stat-green,
span.stat-yellow,
span.stat-orange,
span.stat-red {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
}

.stat-item.stat-green,
span.stat-green {
    text-decoration-color: var(--green);
}

.stat-item.stat-yellow,
span.stat-yellow {
    text-decoration-color: var(--yellow);
}

.stat-item.stat-orange,
span.stat-orange {
    text-decoration-color: var(--orange);
}

.stat-item.stat-red,
span.stat-red {
    text-decoration-color: var(--red);
}

.stat-item {
    margin-bottom: 0.4rem;
}

.sidebar .stats-banner {
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item strong {
    font-weight: bold;
}

.menu-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.menu-tab-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-size: 1em;
    color: var(--text);
    font-weight: normal;
    outline: none;
}

.menu-tab-btn:hover {
    opacity: 0.7;
}

.menu-content {
    width: 100%;
}

.menu-section {
    display: none;
    margin-top: 1rem;
    line-height: 1.4;
    opacity: 0.8;
    font-size: 0.8em;
}

.journey-note,
.journey-status-reason {
    font-size: 0.6em;
    color: var(--red);
    opacity: 0.8;
}

.journey-note {
    font-style: italic;
}

.journey-card.status-green {
    border-color: rgba(var(--green-rgb), 0.8);
}

.journey-card.status-green:hover {
    background-color: rgba(var(--green-rgb), 0.1);
}

.status-indicator.status-green {
    background-color: var(--green);
    box-shadow: 0 0 5px var(--green);
}

.journey-card.status-yellow {
    border-color: rgba(var(--yellow-rgb), 0.8);
}

.journey-card.status-yellow:hover {
    background-color: rgba(var(--yellow-rgb), 0.1);
}

.status-indicator.status-yellow {
    background-color: var(--yellow);
    box-shadow: 0 0 5px var(--yellow);
}

.journey-card.status-orange {
    border-color: rgba(var(--orange-rgb), 0.8);
}

.journey-card.status-orange:hover {
    background-color: rgba(var(--orange-rgb), 0.1);
}

.status-indicator.status-orange {
    background-color: var(--orange);
    box-shadow: 0 0 5px var(--orange);
}

.journey-card.status-red {
    border-color: rgba(var(--red-rgb), 0.8);
}

.journey-card.status-red:hover {
    background-color: rgba(var(--red-rgb), 0.1);
}

.status-indicator.status-red {
    background-color: var(--red);
    box-shadow: 0 0 5px var(--red);
}

.journey-info {
    flex: 1;
}

.journey-date {
    font-size: 1em;
    text-decoration: underline;
    text-transform: uppercase;
    margin-bottom: 0.5em;
    display: block;
    opacity: 0.5;
}

.journey-route {
    font-size: 0.9em;
}

/* Desktop */
@media (min-width: 1024px) {
    body {
        flex-direction: row;
    }

    .container {
        flex-direction: row;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .sidebar {
        width: 300px;
        height: 100vh;
        position: sticky;
        top: 0;
        border-bottom: none;
        font-size: 1em;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        padding: 2rem;
    }

    .sidebar h1 {
        font-size: 1.5rem;
        margin-top: -0.3rem;
        /* Visual alignment fix */
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .menu-tabs {
        flex-direction: row;
        gap: 1.5rem;
    }
}

@media (max-width: 1023px) {
    .menu-tabs {
        margin-top: 0;
        margin-bottom: 2rem;
        justify-content: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Wrapped Cards (Admin / Summary) */
.wrapped-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    margin-top: 2rem;
    padding-bottom: 5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .wrapped-container {
        flex-direction: row;
        overflow-x: auto;
        align-items: flex-start;
        padding-left: 2rem;
        padding-right: 2rem;
        scrollbar-width: thin;
    }

    .wrapped-container::-webkit-scrollbar {
        height: 8px;
    }

    .wrapped-container::-webkit-scrollbar-thumb {
        background: var(--text);
        border-radius: 10px;
    }
}

.wrapped-card {
    flex-shrink: 0;
    width: 350px;
    height: 600px;
    background: linear-gradient(135deg, #2c3e50, #000000);
    color: #fff;
    border-radius: 30px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.wrapped-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Specific Card Themes (can be overridden by inline styles) */
.card-1 {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
}

.card-2 {
    background: linear-gradient(135deg, #4568DC 0%, #B06AB3 100%);
}

.card-3 {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card-4 {
    background: linear-gradient(135deg, #3E5151 0%, #DECBA4 100%);
}

.card-5 {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.wrapped-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 1rem;
    font-weight: bold;
}

.wrapped-big {
    font-size: var(--font-title);
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.wrapped-sub {
    font-size: var(--font-body);
    line-height: 1.4;
    font-weight: 300;
}

.wrapped-footer {
    margin-top: auto;
    font-size: 0.7rem;
    opacity: 0.6;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.wrapped-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.9rem;
}

.wrapped-stats-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.wrapped-stats-list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
}

/* =========================================
   ADMIN DASHBOARD STYLES
   ========================================= */

.nav {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
}

.nav a:hover {
    text-decoration: underline;
}

/* Dashboard Buttons */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.dash-btn {
    background: transparent;
    border: 1px solid var(--text);
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-size: 0.8em;
    transition: all 0.2s;
    display: inline-block;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
}

.dash-btn:hover {
    background: rgba(34, 34, 34, 0.1);
}

/* Forms */
label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--text);
    background: #f9f9f9;
    font-family: inherit;
    font-size: 0.8rem;
    /* Matches body text */
}

.hidden {
    display: none !important;
}

.sub-options {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-left: 2px solid #999;
}

.radio-group label {
    font-weight: normal;
    margin-top: 0.25rem;
}

button.submit {
    margin-top: 2rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--text);
    border-radius: var(--border-radius);
    cursor: pointer;
    width: auto;
    min-width: 150px;
    font-family: inherit;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

button.submit:hover {
    background: rgba(34, 34, 34, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #999;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--text);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    display: inline-block;
    transition: all 0.2s;
    font-weight: bold;
}

.btn-sm:hover {
    background: rgba(34, 34, 34, 0.1);
}

.status-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
}

.status-badge svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* Heatmap */
.heatmap-container {
    display: grid;
    grid-template-columns: 1.5rem repeat(24, minmax(0, 1fr));
    gap: 1px;
    margin-top: 1rem;
    width: 100%;
}

.heatmap-label {
    font-size: 0.6rem;
    opacity: 0.7;
    align-self: center;
}

.heatmap-cell {
    aspect-ratio: 1;
    background: var(--green);
    border-radius: 2px;
    position: relative;
}

.heatmap-cell:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 2px 5px;
    font-size: 0.6rem;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
}

/* Mobile Overrides (Keep minimal) */
@media (max-width: 768px) {
    .wrapped-card {
        width: 300px;
        height: 520px;
        padding: 1.5rem;
    }
}

/* =========================================
   ADMIN PAGE SPECIFIC OVERRIDES
   ========================================= */
body.admin-page {
    /* Reset the global flex sidebar layout */
    display: block;
    flex-direction: unset;

    /* Restore centered layout */
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;

    /* Ensure background matches */
    background-color: var(--bg);
}

@media (min-width: 1024px) {
    body.admin-page {
        flex-direction: unset;
        /* Prevent desktop flex-row */
    }
}
