/* ===== RESET A ZÁKLADNÍ NASTAVENÍ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ===== LAYOUT A KONTEJNERY ===== */
.container {
    padding: 30px;
}

h1 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: 300;
}

/* ===== TLAČÍTKA - ZÁKLADNÍ STRUKTURA ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.btn.large {
    padding: 14px 28px;
    font-size: 14px;
}

.btn.small {
    padding: 6px 12px;
    font-size: 11px;
}

.btn.tiny {
    padding: 4px 8px;
    font-size: 10px;
    text-transform: none;
}

.btn.icon-only {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
}

.btn.icon-only.small {
    padding: 6px;
    min-width: 30px;
}

/* ===== VÝBĚR TYPU A PRIORITY ===== */
.type-selector,
.priority-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.priority-selector {
    align-items: center;
}

.priority-label,
.filter-label {
    font-weight: 500;
    margin-right: 10px;
    font-size: 13px;
}

.filter-label {
    min-width: 60px;
    display: inline-block;
}

/* ===== OVLÁDACÍ PRVKY ===== */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#startBtn {
    flex: 1;
}

/* ===== INDIKÁTOR ===== */
.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.priority-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ===== TEXTOVÉ POLE ===== */
.textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    border: 1px solid;
}

/* ===== FORMULÁŘOVÉ PRVKY ===== */
.input {
    width: 100%;
    padding: 15px;
    font-size: 15px;
    border: 1px solid;
}

.search-input {
    padding: 10px 16px;
    font-size: 14px;
}

/* ===== STAVOVÝ ŘÁDEK ===== */
.status-bar {
    margin-top: 15px;
    padding: 12px 15px;
    font-size: 13px;
    text-align: center;
    border: 1px solid;
}

.interim-text {
    font-style: italic;
}

/* ===== INFORMAČNÍ PANEL ===== */
.storage-info {
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid;
}

/* ===== TOGGLE SEKCE ===== */
.toggle-section {
    margin-top: 20px;
    padding: 12px 15px;
    border: 1px solid;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.toggle-arrow {
    transition: transform 0.3s ease;
}

.toggle-section.expanded .toggle-arrow {
    transform: rotate(180deg);
}

/* ===== KONTEJNERY PRO ROZBALOVACÍ SEKCE ===== */
.history-container,
.options-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 10px;
}

.history-container.expanded {
    max-height: 800px;
    overflow-y: auto;
}

.options-container.expanded {
    max-height: 300px;
}

/* OPRAVA: Speciální pravidla pro filters container */
.filters-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-bottom: 0;
}

.filters-container.expanded {
    max-height: 400px;
    margin-bottom: 15px;
}

/* Odstranit padding když je zavřené */
.filters-container:not(.expanded) {
    padding: 0 !important;
}

/* ===== HISTORIE POLOŽKA ===== */
.history-item {
    border: 1px solid;
    border-left-width: 3px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.history-item-actions {
    display: flex;
    gap: 8px;
}

.history-item-actions button {
    padding: 4px 8px;
    font-size: 16px;
    min-width: 36px;
}

.history-item-preview {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    line-height: 1.5;
}

.history-item-full-text {
    font-size: 14px;
    white-space: pre-wrap;
    margin-top: 10px;
    padding: 10px;
    display: none;
    border: 1px solid;
}

.history-item.expanded .history-item-full-text {
    display: block;
}

.history-empty {
    text-align: center;
    padding: 30px;
    font-style: italic;
}

/* ===== FILTRY ===== */
.filter-container {
    padding: 16px;
    border: 1px solid;
}

.history-filter,
.history-date-filter,
.history-priority-filter,
.pagination-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.history-search {
    margin-bottom: 10px;
}

.btn.filter {
    padding: 6px 14px;
    font-size: 12px;
    text-transform: none;
}

/* ===== FILTER SUMMARY ===== */
.filter-summary {
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

/* ===== STRÁNKOVÁNÍ ===== */
.load-more-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== MOŽNOSTI ===== */
.options-content {
    border: 1px solid;
    padding: 20px;
}

.options-warning {
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.options-buttons {
    display: flex;
    gap: 10px;
    flex-direction: row;
}

/* ===== PATIČKA ===== */
.footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid;
}

.footer a {
    text-decoration: none;
    font-weight: 500;
}

/* ===== MODÁLNÍ OKNA ===== */
.gdpr-modal,
.export-modal,
.email-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.gdpr-modal-content,
.export-modal-content,
.email-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    width: 90%;
    border: 1px solid;
}

.gdpr-modal-content {
    max-width: 500px;
}

.export-modal-content,
.email-modal-content {
    max-width: 400px;
}

.export-modal-content {
    text-align: center;
}

.gdpr-modal h3,
.export-modal h3,
.email-modal h3 {
    margin-bottom: 20px;
    text-align: center;
}

.gdpr-modal p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.gdpr-modal ul {
    margin: 15px 0;
    padding-left: 25px;
}

.gdpr-modal li {
    margin-bottom: 8px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.email-modal-buttons {
    display: flex;
    gap: 10px;
}

/* ===== PŘEPÍNAČ TÉMAT - STRUKTURA ===== */
.theme-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 4px;
}

.theme-switcher-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border: none;
    cursor: pointer;
    padding: 4px;
    position: relative;
    border-radius: 50%;
}

.theme-toggle-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    flex-wrap: wrap;
}

.theme-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.theme-toggle-btn .theme-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    padding: 8px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.theme-switcher-floating:hover .theme-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dropdown .theme-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.theme-dropdown .theme-dot {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.theme-name {
    font-size: 13px;
}

/* ===== NOVÉ DOPLŇKY ===== */

/* Grid pro kategorie - zajistí stejnou velikost */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.btn.category {
    width: 100%;
    min-height: 60px;
    padding: 15px 10px;
    justify-content: center;
    text-align: center;
}

/* Toggle pro režim vkládání */
.insert-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    font-size: 14px;
}

.insert-mode-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Oprava filter skupin */
.filter-group {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Vycentrované tlačítka v možnostech */
.options-buttons-centered {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Jednotné toggle sekce */
.toggle-section .toggle-text {
    font-weight: 500;
}

/* Oprava pro tlačítka v historii */
.history-item-actions .btn {
    padding: 4px 8px;
    font-size: 14px;
}

/* ===== RESPONZIVNÍ DESIGN ===== */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 20px;
    }

    .btn {
        font-size: 12px;
        padding: 8px 14px;
    }

    .btn.small {
        font-size: 10px;
        padding: 5px 10px;
    }

    .textarea {
        min-height: 250px;
        font-size: 14px;
    }

    .priority-selector {
        flex-wrap: wrap;
    }

    .priority-label {
        width: 100%;
        margin-bottom: 10px;
    }

    .btn.telefon,
    .btn.schuzka,
    .btn.poznamka,
    .btn.ukol {
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
    }
    
    /* Responzivní design pro kategorie */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insert-mode-toggle {
        padding: 0 10px;
        font-size: 13px;
    }
    
    .options-buttons-centered {
        flex-direction: column;
    }
    
    .options-buttons-centered .btn {
        width: 100%;
    }
}
