/* ==========================================================================
   HLAVNÍ KONFIGURACE A PROMĚNNÉ
   ========================================================================== */
:root {
    /* Hlavní barvy - --primary se mění přes PHP podle nastavení uživatele */
    --primary: #2563EB;        /* Výchozí modrá */
    --primary-dark: #1E40AF;   /* Tmavší pro hover */
    --success: #10B981;        /* Zelená (tlačítka Nový) */
    --success-dark: #059669;
    --danger: #EF4444;         /* Červená (Smazat, Odhlásit) */
    
    /* Texty a Pozadí */
    --text-main: #111827;      /* Téměř černá */
    --text-light: #6B7280;     /* Šedá pro popisky */
    --bg-body: #F3F4F6;        /* Světle šedé pozadí aplikace */
    --white: #ffffff;
    
    /* Rozměry */
    --sidebar-width: 250px;
    --header-height: 60px;
    
    /* Ostatní */
    --border: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Animace načtení */
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }


/* ==========================================================================
   1. VEŘEJNÝ WEB (Landing Page)
   ========================================================================== */
.navigace {
    background: var(--white);
    padding: 0 5%;
    height: 70px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 1000;
}

.navigace .logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.navigace .logo span { color: var(--primary); }

.navigace .menu { display: flex; gap: 2rem; align-items: center; }
.navigace .menu a { font-weight: 500; color: var(--text-main); transition: color 0.2s; }
.navigace .menu a:hover { color: var(--primary); }

.hero-sekce {
    text-align: center;
    padding: 5rem 1rem;
    background: linear-gradient(to bottom, #ffffff, #f3f4f6);
    min-height: 80vh; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-nadpis { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; line-height: 1.2; color: #111; }
.hero-popis { max-width: 600px; margin: 0 auto 2rem auto; color: #555; font-size: 1.2rem; }
.google-play-btn img { height: 60px; transition: transform 0.2s; }
.google-play-btn:hover img { transform: scale(1.05); }


/* ==========================================================================
   2. PŘIHLAŠOVACÍ STRÁNKA
   ========================================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F3F4F6;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.login-card .form-group { width: 100%; margin-bottom: 1.5rem; }
.login-card label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.login-card input {
    width: 100% !important; 
    display: block; padding: 0.75rem;
    border: 1px solid #D1D5DB; border-radius: 6px; box-sizing: border-box;
}

.login-card .btn-submit { width: 100%; justify-content: center; margin-top: 10px; }


/* ==========================================================================
   3. APLIKACE / PORTÁL (Sidebar Layout)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed; left: 0; top: 0;
    display: flex; flex-direction: column;
    z-index: 500;
}

.sidebar-header {
    height: var(--header-height);
    display: flex; align-items: center; padding-left: 1.5rem;
    font-size: 1.4rem; font-weight: 800;
    border-bottom: 1px solid var(--border);
}
.sidebar-header span { color: var(--primary); }

.menu-list { flex: 1; padding: 1rem 0; overflow-y: auto; }
.menu-list li { margin-bottom: 4px; }

/* Základní odkaz v menu */
.menu-list > li > a {
    display: flex; align-items: center;
    padding: 10px 20px;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-list > li > a i { width: 24px; margin-right: 10px; color: var(--text-light); font-size: 1.1em; }

.menu-list > li > a:hover { background: var(--bg-body); color: var(--primary); }
.menu-list > li > a:hover i { color: var(--primary); }

.menu-list > li > a.active {
    background: #EFF6FF; 
    color: var(--primary);
    border-left-color: var(--primary);
}
.menu-list > li > a.active i { color: var(--primary); }

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex; flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem;
    position: sticky; top: 0; z-index: 400;
}
.page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.user-menu { display: flex; align-items: center; gap: 15px; }
.user-name { font-weight: 500; }
.user-avatar {
    width: 32px; height: 32px;
    background: var(--primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.9rem;
}

/* Content */
.content { padding: 2rem; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }


/* ==========================================================================
   4. UI KOMPONENTY
   ========================================================================== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem; margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary {
    background: var(--success); color: white; border: none;
    padding: 0.6rem 1.2rem; border-radius: 6px;
    font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background 0.2s; font-size: 0.95rem;
}
.btn-primary:hover { background: var(--success-dark); }

.btn-secondary {
    background: white; border: 1px solid var(--border);
    color: var(--text-main); padding: 0.5rem 1rem; border-radius: 6px;
    cursor: pointer; transition: background 0.2s;
}
.btn-secondary:hover { background: var(--bg-body); border-color: #ccc; }

.btn-submit {
    background: var(--primary); color: white; border: none;
    padding: 0.7rem 1.5rem; border-radius: 6px; cursor: pointer;
    font-weight: 600; text-decoration: none; display: inline-block;
}
.btn-submit:hover { background: var(--primary-dark); }


/* FORMULÁŘE & TABULKY */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-control {
    width: 100%; padding: 0.6rem 0.8rem;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.95rem; color: var(--text-main); background: #fff;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; padding: 0.8rem 1rem;
    background: #F9FAFB; border-bottom: 1px solid var(--border);
    color: var(--text-light); font-weight: 600; font-size: 0.85rem;
}
td { padding: 1rem; border-bottom: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
tr:hover td { background: #F9FAFB; }

#modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 2000; backdrop-filter: blur(2px);
}

/* ==========================================================================
   5. ROLOVACÍ MENU (DROPDOWN) - NOVÉ
   ========================================================================== */

/* Seznam podmenu - ve výchozím stavu skryté */
.submenu-list {
    display: none; 
    background-color: #F8FAFC; /* Světlejší pozadí pro odlišení */
    margin: 0; padding: 0;
    box-shadow: inset 0 4px 6px -4px rgba(0,0,0,0.05);
}

/* Třída, která se přidává přes JS pro zobrazení */
.submenu-list.open {
    display: block !important;
    animation: slideDown 0.2s ease-out;
}

/* Položky v podmenu */
.submenu-list li a {
    padding: 8px 10px 8px 50px !important; /* Větší odsazení zleva */
    font-size: 0.9rem;
    color: #4B5563; /* Jemnější šedá */
    border-left: 3px solid transparent;
    display: flex; align-items: center;
}

.submenu-list li a:hover {
    color: var(--primary);
    background-color: #EFF6FF;
}

.submenu-list li a i {
    font-size: 1rem; width: 20px; margin-right: 8px;
    color: #9CA3AF; /* Šedé ikony v podmenu */
}
.submenu-list li a:hover i { color: var(--primary); }

/* Šipka pro rozbalení */
.menu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

/* Otočení šipky, když je menu aktivní (přidává JS na <a>) */
.menu-toggle.active .menu-arrow {
    transform: rotate(180deg);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .navigace { padding: 0 1rem; }
    .navigace .menu { display: none; }
    
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    
    .main-wrapper { margin-left: 0; width: 100%; }
    .top-bar { padding: 0 1rem; }
    .content { padding: 1rem; }
    
    .mobile-toggle { display: block !important; font-size: 1.2rem; cursor: pointer; margin-right: 15px; }
}
.mobile-toggle { display: none; }