/* Globális alapok */
:root {
    --primary: #4a90e2;
    --secondary: #6c757d;
    --success: #28a745;
    --bg: #e9ecef;
    --text: #333;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 50px;
}

.main-title {
    margin-bottom: 30px;
    font-size: 24px;
    color: #444;
}

/* Konténer */
.container {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

h2 {
    margin-bottom: 20px;
    text-align: center;
}

/* Űrlap elemek */
.standard-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: -10px;
}

input, select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
}

/* GOMBOK - Itt tüntetjük el a keretet */
button, .btn-submit, .btn-secondary {
    border: none; /* NINCS KERET */
    outline: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-submit {
    background-color: var(--primary);
    color: white;
}

.btn-submit:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #eee;
    color: var(--secondary);
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: #ddd;
}

/* Üzenetek */
.success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Szélesebb konténer az összetett űrlapokhoz */
.container.wide {
    max-width: 600px;
}

/* Javított kétoszlopos elrendezés */
.grid-form {
    display: grid;
    /* Csak akkor lesz két oszlop, ha van legalább 250px helyük, különben egymás alá ugranak */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    align-items: flex-end; /* Hogy a különböző magasságú mezők alja egy vonalban legyen */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Feliratok (label) formázása, hogy ne érjenek össze */
.form-group label {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 600;
    white-space: nowrap; /* Megakadályozza a felirat törését */
}

/* Különleges esetek: a név és a gombok mindig teljes szélességűek maradjanak */
.full-width {
    grid-column: 1 / -1; 
}
.full-width {
    grid-column: span 2;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.checkbox-group input {
    width: auto;
}

/* Mobilnézet: egy oszlopba rendezés */
@media (max-width: 500px) {
    .grid-form {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}

/* Progress Bar */
.kcal-bar-container {
    background: #eee;
    border-radius: 10px;
    height: 20px;
    width: 100%;
    margin: 10px 0;
    overflow: hidden;
}

.kcal-bar {
    height: 100%;
    /* A sárga szín pontosan a sáv felénél (50%) lesz a legintenzívebb */
background: linear-gradient(90deg, #1a1a1a, #00f2fe);
    transition: width 0.5s ease-in-out;
}

/* Összegző doboz a Dashboardon */
.summary-box {
    background: #f9fbf9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

/* Adattáblázat stílusa */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.data-table th {
    background: #f4f4f4;
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid #ddd;
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background-color: #fcfcfc;
}

/* Recept építő sorai */
.recipe-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 24px; /* Kicsit növelhetjük, hogy jobban kitöltse */
    
    /* A tökéletes középre igazítás titka: */
    display: inline-flex;
    align-items: center;     /* Függőlegesen középre */
    justify-content: center;  /* Vízszintesen középre */
    
    line-height: 1;          /* Kiküszöböli a böngésző extra sorátugrásait */
    padding: 0;              /* Megszünteti az eltolódást okozó belső margókat */
}

.btn-remove:hover {
    background: #c0392b;
}

/* Az összegző rész kiemelése */
.summary-box p {
    display: grid;
    /* Három oszlop: név (táguló), érték (fix szélesség), mértékegység (fix szélesség) */
    grid-template-columns: 1fr auto 30px; 
    gap: 10px;
    margin: 8px 0;
    align-items: center;
}

.summary-box span {
    font-weight: bold;
    color: var(--primary);
    text-align: right; /* A számot az oszlop jobb szélére tolja */
    font-variant-numeric: tabular-nums; /* Biztosítja, hogy minden számjegy ugyanolyan széles legyen */
}

.summary-box .unit {
    text-align: right;
    color: var(--secondary);
    font-size: 0.9em;
}
/* --- REPORT SPECIFIKUS ELEMEK --- */
.container.report {
    max-width: 1000px; /* A grafikonnak kell a tér */
    width: 95%;
}

.report-header {
    text-align: center;
    margin-bottom: 25px;
}

.report-header p {
    color: var(--secondary);
    font-weight: 500;
}

canvas {
    margin-top: 30px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
}

/* Tab rendszer */
.tab-container {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
    transition: 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    display: none; /* Alapból minden fül rejtve */
}

.tab-content.active {
    display: block; /* Csak az aktív látszik */
}
