/* =====================================================
   DOMÁCÍ DASHBOARD - Dark Theme
   ===================================================== */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d2e;
    --bg-card: #1e2235;
    --bg-hover: #252840;
    --primary-color: #1e2235;
    --secondary-color: #252840;
    --accent-color: #4a9eff;
    --accent-hover: #3a8eef;
    --accent-green: #22c55e;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d3352;
    --border-hover: #3d4472;
    --navbar-height: 60px;
    --sidebar-width: 220px;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
    --radius: 0.75rem;
    --radius-sm: 0.375rem;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    white-space: nowrap;
    margin-right: 1rem;
}

.navbar-brand:hover {
    color: var(--accent-color) !important;
    text-decoration: none !important;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    flex-wrap: wrap;
}

.navbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.navbar-nav a:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
    text-decoration: none;
}

.navbar-nav a.active {
    color: var(--accent-color);
    background-color: rgba(74, 158, 255, 0.12);
}

.logout-btn {
    background: none;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: var(--accent-red);
    color: white;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--navbar-height);
    padding: 2rem 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255,255,255,0.02);
}

/* ===== GRID / ROW ===== */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.col { }

.col-2 {
    grid-column: span 2;
}

/* ===== STATS ===== */
.stat-box {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.stat-box:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }

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

.btn-success {
    background-color: var(--accent-green);
    color: white;
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
}

.btn-warning {
    background-color: var(--accent-yellow);
    color: #1a1a1a;
}

.btn-secondary {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

legend {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0 0.5rem;
}

/* ===== TABLE ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: rgba(255,255,255,0.02);
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-left-color: var(--accent-green);
    color: #86efac;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: var(--accent-red);
    color: #fca5a5;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-left-color: var(--accent-yellow);
    color: #fcd34d;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1d2e 0%, #0f1117 70%);
}

.login-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.login-hint {
    background-color: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===== WELCOME / DASHBOARD ===== */
.welcome-section {
    margin-bottom: 2rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow);
}

.welcome-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.welcome-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background-color: rgba(34,197,94,0.15); color: #86efac; }
.badge-danger  { background-color: rgba(239,68,68,0.15);  color: #fca5a5; }
.badge-warning { background-color: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-info    { background-color: rgba(74,158,255,0.15); color: #93c5fd; }

/* ===== SPINNER ===== */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HEADINGS ===== */
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }

p { margin-bottom: 0.5rem; }

/* ===== CHECKBOX ===== */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* ===== SHOPPING LIST ===== */
.shopping-item-done td {
    opacity: 0.5;
    text-decoration: line-through;
}

/* ===== PANTRY ===== */
.low-stock {
    color: var(--accent-yellow);
    font-weight: 600;
}

/* ===== CHARTS ===== */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

/* ===== HAMBURGER MENU ===== */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.navbar-hamburger:hover { background: var(--bg-hover); }
.navbar-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s;
}
.navbar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Navbar – hamburger místo rozbalené navigace */
    .navbar {
        height: var(--navbar-height);
        overflow: visible;
    }
    .navbar-container {
        padding: 0 1rem;
        flex-wrap: nowrap;
        position: relative;
    }
    .navbar-brand { margin-right: 0; }

    .navbar-hamburger { display: flex; }

    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.2rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        z-index: 200;
        flex-wrap: nowrap;
    }
    .navbar-nav.open { display: flex; }

    .navbar-nav a {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
        width: 100%;
    }
    .navbar-nav > span,
    .navbar-nav > form {
        padding: 0.4rem 0.75rem;
    }
    .logout-btn {
        width: 100%;
        padding: 0.55rem 0.75rem;
        font-size: 0.9rem;
        text-align: left;
    }

    /* Obsah */
    .main-content { padding: 1rem 0.75rem; }
    .row { grid-template-columns: 1fr; }
    .col-2 { grid-column: span 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 1.2rem; margin-bottom: 1rem; }
    h2 { font-size: 1.05rem; }

    /* Tabulky – horizontální scroll */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.5rem 0.6rem; white-space: nowrap; }

    /* Karty */
    .card-body { padding: 1rem; }
    .card-header { padding: 0.75rem 1rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-box { padding: 1.5rem; margin: 1rem; }
    .main-content { padding: 0.75rem 0.5rem; }
    .btn { font-size: 0.85rem; }
}
