:root {
    color-scheme: dark;
}

body {
    background: #121212;
    color: #f1f1f1;
    min-height: 100vh;
}

/* Cards */
.card {
    background-color: #1e1e1e !important;
    color: #f1f1f1 !important;
    border: 1px solid #2b2b2b !important;
}

/* Forms */
.form-control {
    background-color: #2b2b2b !important;
    border-color: #444 !important;
    color: #f1f1f1 !important;
}

.form-control:focus {
    background-color: #333 !important;
    border-color: #0d6efd !important;
    color: #f1f1f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.form-label {
    color: #e5e5e5 !important;
}

/* Alerts */
.alert-danger {
    background-color: #4a1515 !important;
    border-color: #7f1d1d !important;
    color: #f8d7da !important;
}

.alert-success {
    background-color: #12341a !important;
    border-color: #1f5130 !important;
    color: #d1f7dc !important;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid #222 !important;
}

/* Links */
a,
a:hover {
    color: #0d6efd !important;
}

/* Muted */
.text-muted {
    color: #aaaaaa !important;
}

/* Disabled nav item */
.nav-link.disabled {
    opacity: 0.7;
    cursor: default;
}

/* ===================== */
/*   TABLE DARK MODE     */
/* ===================== */

.table {
    background-color: #1a1a1a !important;
    color: #f1f1f1 !important;
    border-color: #333 !important;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    border-color: #333 !important;
    color: #f1f1f1 !important;   /* ← deze erbij */
}

.table thead th {
    background-color: #222 !important;
    border-bottom: 2px solid #444 !important;
    color: #f1f1f1 !important;
}

.table tbody tr:nth-child(even) {
    background-color: #181818 !important;
}

.table tbody tr:hover {
    background-color: #262626 !important;
}

/* Responsive wrapper */
.table-responsive {
    border: 1px solid #2b2b2b;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Force text color inside table cells */
.table-dark-custom td,
.table-dark-custom th,
.table-dark-custom tbody td,
.table-dark-custom tbody th,
.table-dark-custom thead th,
.table-dark-custom > :not(caption) > * > * {
    color: #f1f1f1 !important;
}

/* Navbar links in dark mode */
.navbar .nav-link {
    color: #cccccc !important;
}

/* Actieve pagina in de navbar */
.navbar .nav-link.active {
    color: #ffffff !important;
    font-weight: 600;
    border-bottom: 2px solid #0d6efd;
}

/* Hover-effect voor niet-actieve links */
.navbar .nav-link:not(.active):hover {
    color: #ffffff !important;
}


/* iPhone-style "glass" navbar */
.navbar-glass {
    position: sticky;      /* blijft bovenaan plakken bij scrollen */
    top: 0;
    z-index: 1030;

    background: rgba(10, 10, 15, 0.75);  /* semi-transparant donker */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* voor Safari / iOS */

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Klein beetje extra padding zodat content niet te dicht erop zit */
body {
    background: #121212;
    color: #f1f1f1;
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* extra ruimte + safe area */
}

/* Placeholder kleur voor donkere modus */
::placeholder {
    color: #bbbbbb !important;
    opacity: 1 !important; /* voorkomt dat browsers het zelf dimmen */
}

/* Voor compatibiliteit met Safari / oudere browsers */
::-webkit-input-placeholder {
    color: #bbbbbb !important;
}
::-moz-placeholder {
    color: #bbbbbb !important;
}
:-ms-input-placeholder {
    color: #bbbbbb !important;
}
:-moz-placeholder {
    color: #bbbbbb !important;
}


/* ============= */
/* Macro circles */
/* ============= */

.macro-rings-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center; /* was: flex-start */
}

.macro-ring {
    width: 120px;
    text-align: center;
    font-size: 0.85rem;
}

.macro-ring svg {
    width: 100%;
    height: auto;
}

/* Alleen de cirkels roteren, niet de tekst */
.macro-ring .bg-circle,
.macro-ring .progress-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.macro-ring .bg-circle {
    fill: none;
    stroke: #333;
    stroke-width: 8;
}

.macro-ring .progress-circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.macro-ring .macro-value,
.macro-ring .macro-sub {
    fill: #f1f1f1;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.macro-ring .macro-value {
    font-size: 18px;
    font-weight: 600;
}

.macro-ring .macro-sub {
    font-size: 11px;
    opacity: 0.8;
}

.macro-ring .macro-title {
    margin-top: 0.35rem;
    font-weight: 600;
}

.macro-ring .macro-extra {
    font-size: 0.75rem;
    color: #aaaaaa;
}

/* Kleuren per macro */
.macro-cal  .progress-circle { stroke: #0d6efd; } /* blauw */
.macro-prot .progress-circle { stroke: #f4b000; } /* oranje/geel */
.macro-carbs .progress-circle { stroke: #00c2b8; } /* turquoise */
.macro-fat  .progress-circle { stroke: #a855f7; } /* paars */


/* Compacte tabellen voor mobiel (calories.php) */
.table-mobile-sm th,
.table-mobile-sm td {
    font-size: 0.8rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

@media (max-width: 576px) {
    .table-mobile-sm th,
    .table-mobile-sm td {
        font-size: 0.75rem;
    }
}

/* ===================== */
/*   MODALS DARK MODE    */
/* ===================== */

.modal-content {
    background-color: #1e1e1e !important;
    color: #f1f1f1 !important;
    border: 1px solid #2b2b2b !important;
}

.modal-header,
.modal-footer {
    border-color: #333 !important;
}

.modal-title {
    color: #f1f1f1 !important;
}

/* Donkere backdrop */
.modal-backdrop.show {
    opacity: 0.75 !important;
}

/* Close-knop (kruisje) wit maken */
.btn-close {
    filter: invert(1) grayscale(100%) !important;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Form selects ook dark maken (zoals form-control) */
.form-select {
    background-color: #2b2b2b !important;
    border-color: #444 !important;
    color: #f1f1f1 !important;
}

.form-select:focus {
    background-color: #333 !important;
    border-color: #0d6efd !important;
    color: #f1f1f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* ===================== */
/*   Bottom navigation   */
/* ===================== */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.7);
    padding: 10px 0 calc(20px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    z-index: 1050;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #aaaaaa;
    font-size: 0.75rem;
    padding-top: 2px;
}

.bottom-nav a .bottom-nav-icon {
    display: block;
    font-size: 1.3rem;
    line-height: 1;
}

.bottom-nav a .bottom-nav-label {
    display: block;
    margin-top: 2px;
}

/* Active state – zelfde idee als navbar */
.bottom-nav a.active {
    color: #ffffff;
    font-weight: 600;
    position: relative;
}

.bottom-nav a.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    border-radius: 999px;
    background-color: #0d6efd; /* zelfde blauw als bovenste navbar */
}

.bottom-nav a.active .bottom-nav-icon {
    transform: translateY(-1px);
}

