:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: white;
}

header h1 {
    font-size: 2.5rem;
    color: inherit;
}

/* Vyhledávací panel */
.search-panel {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Vyhledávací box */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tlačítka vyhledávání */
.btn-search,
.btn-clear {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-clear {
    background: var(--secondary);
    color: white;
}

.btn-clear:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(100, 116, 139, 0.3);
}

.btn-search:active,
.btn-clear:active {
    transform: translateY(0);
}

/* Animace při kliknutí */
.btn-active {
    animation: btnPulse 0.2s ease-in-out;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

/* Filtry */
.filters {
    display: flex;
    gap: 12px;
}

.filters select {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

/* Statistiky */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

/* Tabulka */
.table-wrapper {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Počítadlo výsledků */
.result-count {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tbody tr {
    transition: background-color 0.15s;
}

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

.loading-row td,
.no-results {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    font-style: italic;
}

.btn-detail {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-detail:hover {
    background: var(--primary-dark);
}

/* Stránkování */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pagination button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.pagination button:hover {
    background: var(--primary-dark);
}

.pagination button:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

.page-info {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: var(--text);
    font-size: 24px;
}

/* Detail grid */
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.detail-value {
    color: var(--text);
    font-size: 14px;
}

/* Toast notifikace */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
    max-width: 400px;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    background: var(--primary);
}

.toast-success {
    background: var(--success);
}

.toast-danger {
    background: var(--danger);
}

/* Responsivní design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .btn-search,
    .btn-clear {
        width: 100%;
        padding: 14px;
    }
    
    #searchInput {
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    table {
        min-width: 800px;
    }
    
    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .toast {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    #searchInput {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .btn-search,
    .btn-clear {
        font-size: 13px;
        padding: 12px;
    }
}

/* Tablet layout */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-box {
        display: grid;
        grid-template-columns: 1fr auto auto;
    }
}
