:root {
    /* ===== Colors ===== */
    --bg: #121212;
    --surface: #1e1e1e;
    --primary: #bb86fc;
    --secondary: #8e3edc;
    --accent: #c792ff;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --input-bg: #2a2a2a;
    --input-border: #333;
    --button-gradient: linear-gradient(135deg, var(--accent), var(--secondary));
    --button-hover-gradient: linear-gradient(135deg, #b678ff, #7a2ec7);
    --shadow-light: rgba(187, 134, 252, 0.35);
    --shadow-strong: rgba(187, 134, 252, 0.55);
    --border: #2a2a2a;
    --text: #e0e0e0;
    --muted: #9e9e9e;
    --danger: #b00020;
    --radius: 8px;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 16px;
    background-color: var(--bg);
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 72px auto 0;
}

h1 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 24px;
    margin-top: auto;
}

h2 {
    color: var(--accent);
    text-align: center;
    margin-bottom: 10px;
    margin-top: 10px;
}

h3 {
    color: var(--text-secondary); 

    margin-bottom: 5px;
    margin-top: 10px;
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background-color: #121212;
    padding: 16px 0;
}

table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    border-collapse: collapse;
}

table::-webkit-scrollbar {
    height: 8px;
}

/* Paragraphs */
p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Optional emphasis inside paragraphs */
p strong {
    color: var(--text-primary);
    font-weight: 600;
}

p.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Lists */
ul,
ol {
    margin: 8px 0 16px 40px;
    padding: 0;
    color: var(--text-secondary);
}

li {
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
}

/* Custom bullet for unordered lists */
ul li::marker {
    color: var(--primary);
}

/* Nested lists */
li ul,
li ol {
    margin-top: 6px;
    margin-bottom: 6px;
}

/* List text emphasis */
li strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Overlay ===== */
#page-overlay,
/* ===== Overlay ===== */
#page-overlay,
.overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#page-overlay {
    background: rgba(255, 255, 255, 0.65);
}
.overlay {
    background: rgba(0, 0, 0, 0.55);
}

.overlay.show,
#page-overlay.show {
    display: block; 
    opacity: 1;
    pointer-events: auto;
}


#page-overlay p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;

    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}


/* ===== Form Styles ===== */
.form-container {
    background: var(--surface);
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 20px;
    padding-right:20px;

    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;

}

.form-container label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-container form{
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

.form-container .row {
    display: flex;
    margin-top: 10px;
    margin-bottom: 10px;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
}


input {
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 16px;
    flex: 1;
    min-width: 50px;
    width: auto;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.form-container label {
    display: block;
    margin-top: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-container input[type="text"],
.form-container input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-container input[type="checkbox"] {
    margin-top: 4px;
}

/* Autofill / browser styles */
.form-container input:-webkit-autofill,
.form-container input:-webkit-autofill:hover,
.form-container input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset !important;
    box-shadow: 0 0 0px 1000px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

 /* ===== Buttons ===== */
button{
    display: inline-flex; 
    width: 100%;
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    cursor: pointer;
    border: none;
    border-radius: 12px;
    margin: 10px 0 10px 0;
    font-weight: 700;
    text-align: center;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

button {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: var(--button-gradient);
    color: var(--text-primary);
    box-shadow: 0 0 8px var(--shadow-light);
}

button:hover {
    background: var(--button-hover-gradient);
    box-shadow: 0 0 12px var(--shadow-strong);
}

button:active {
    transform: scale(0.98);
}

/* Ghost variant */
.button--ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(187, 134, 252, 0.25);
}

.button--soft {
    background: rgba(187, 134, 252, 0.15);
    color: var(--accent);
    border: 1px solid rgba(187, 134, 252, 0.25);
    box-shadow: 0 0 6px rgba(187, 134, 252, 0.15);
}

.mdc-button {
    box-shadow: none !important; /* Remove ripple's shadow effect */
}

 /* ===== Smaller Buttons ===== */
.abtn {
    display: inline-flex;           /* flex for icon + optional text */
    align-items: center;            /* vertically center */
    justify-content: center;        /* horizontally center */
    gap: 6px;                       /* spacing between icon and text */

    padding: 8px 14px;              /* size for icon buttons */
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    margin: 10px 0 10px 0;

    background: linear-gradient(135deg, #c792ff, #8e3edc);
    color: #fff;

    border: none;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;

    line-height: 1; /* prevents shrinking inside flex */
    vertical-align: middle;

    box-shadow: 0 0 8px rgba(187, 134, 252, 0.35);
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.abtn:hover {
    background: linear-gradient(135deg, #b678ff, #7a2ec7);
    box-shadow: 0 0 12px rgba(187, 134, 252, 0.55);
}

.abtn:active {
    transform: scale(0.98);
}

.abtn--soft {
    background: rgba(187, 134, 252, 0.15);
    color: var(--accent);
    border: 1px solid rgba(187, 134, 252, 0.25);
    box-shadow: 0 0 6px rgba(187, 134, 252, 0.15);
}

.abtn--soft:hover {
    background: rgba(187, 134, 252, 0.25);
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.3);
}

.abtn--ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(187, 134, 252, 0.25);
}

.abtn--ghost:hover {
    background: rgba(187, 134, 252, 0.1);
}

/* Danger variant */
.abtn--danger {
    background: var(--danger);
    color: #fff;
}

.abtn--danger:hover {
    background: #d32f2f;
}

/* Material icon inside button */
.abtn .material-icons {
    font-size: 1.2em;   /* adjust icon size */
    vertical-align: middle;
}
/* ===== Meal Sections ===== */
.meal-section {
    margin-bottom: 16px;
}

.meal-section summary {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    list-style: none;
}

.meal-section summary::-webkit-details-marker {
    display: none;
}

.meal-section summary::after {
    content: 'expand_more';
    font-family: 'Material Icons';
    position: absolute;
    right: 16px;
    color: var(--primary);
    transition: transform 0.3s;
}

.meal-section[open] summary::after {
    transform: rotate(180deg);
}

.meal-entries {
    padding: 16px;
    background: var(--surface);
    border-radius: 8px 8px 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.meal-entries--collapsable {
    padding: 16px;
    background: var(--surface);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
}

/* ===== Entry Cards ===== */
.entry-card {
    margin-bottom: 10px;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--input-bg);
}

.mdc-card {
    background-color: var(--surface);
    border-radius: 8px;
}

.mdc-card.entry-card{
    background: var(--input-bg);
}

.mdc-card__content {
    padding: 16px;
}

.entry-card h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.2s;
}

.entry-card h3:hover {
    background-color: #3a3a3a;
}

.entry-card li,
.mdc-card li {
    color: var(--text-secondary);
}

.copy-icon {
    font-size: 18px;
    color: var(--primary);
    opacity: 0.7;
}

.entry-card h3:hover .copy-icon {
    opacity: 1;
}

.entry-card p {
    margin: 0 0 12px 3px;
    color: var(--text-secondary);
}

.nutrients {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nutrients span {
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-primary);
}

.calories {
    font-weight: bold;
    background: #4a148c;
    color: var(--text-primary);
    cursor: pointer;
}

.calories:hover {
    background: #6a1b9a;
}

.no-entries {
    text-align: center;
    padding: 32px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: var(--text-secondary);
}

/* ===== Modals ===== */
.modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    width: 90%;
    display: flex;
    flex-direction: column;
    text-align: center;
    color: var(--text-primary);
}
.modal-buttons {
    margin-top: 16px;
    display: flex;
    width: 100%;
    justify-content: space-evenly;
}

.modal-content h3 {
    color: var(--text-secondary); 
}

.nutrient-item {
    margin: 8px 0;
    padding: 4px 0;
    border-bottom: 1px solid #444;
}


/* ===== App Bar ===== */
.app-bar {
    height: 56px;
    background: var(--surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,.6);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.menu-btn {
    margin-left: auto;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary);
    border: none;
    background: none;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background: var(--surface);
    padding: 72px 16px 16px;
    box-shadow: 2px 0 12px rgba(0,0,0,.7);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 16px;
    background: #1e1e1e;
    box-shadow: 0 2px 4px rgba(0,0,0,.4);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
}

.sidebar-close {
    font-size: 26px;
    color: var(--primary);
    width:30%;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar a {
    display: flex;
    padding: 12px 10px;
    margin-bottom: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 16px;
    border-radius: 8px;
    align-items: center;
    gap: 12px;
}

.sidebar a .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.sidebar a:hover {
    background: rgba(187,134,252,.14);
}

.sidebar-status {
    padding: 12px 8px;
    margin-bottom: 8px;
    text-align: center;
    display: flex;
    flex-direction: column; /* or row */
    gap: 15px; /* space between children */

}

.fs-connected {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(139,195,74,0.15);
    padding: 6px 12px;
    border-radius: 10px;
    color: #8BC34A;
    font-weight: 600;
    font-size: 13px;
    justify-content: center;
    
}


.fs-connect:hover {
    background: #a96df0;
}


.fs-connected .material-icons {
    font-size: 16px;
}


.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 8px 0 12px;
}

/* ---------- TABLE ---------- */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-weight: 500;
}

td {
    vertical-align: middle;
    text-align: center;
}

td.username {
    word-break: break-word;
}

.shared-text {
    color: #c9a8ff;
    font-weight: 600;
}


.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px;
}


 /* ---------- ACTIONS ---------- */

.actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 16px;
}

.actions form {
    display: inline-flex;
}
.actions form .btn {
    padding: 8px 14px;        /* same as other buttons */
    font-size: 0.9rem;
    display: inline-flex;      /* ensure icon is centered */
    align-items: center;
    justify-content: center;
    gap: 6px;
}


.flash {
    background: #4a148c;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.md-content {
    max-width: 100%;
}

.md-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    border-collapse: collapse;
}

/* Optional: make scrolling smoother on mobile */
.md-content table::-webkit-scrollbar {
    height: 8px;
}
