/* 
 * Custom CSS pro registrační systém kurzů
 * Umístění: /opt/kurzy/static/css/style.css
 */

/* Root proměnné */
:root {
    --primary-color: #8B4789;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Základní styly */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* Prostor pro fixed navbar */
}

main {
    flex: 1;
}

/* Navbar */

/* Oprava z-index pro admin sidebar */
.sidebar {
    z-index: 100 !important;
}

.navbar {
    z-index: 1050 !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-brand i {
    font-size: 1.8rem;
    margin-right: 0.5rem;
}

/* Karty kurzů */
.card {
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important;
}

.card-header {
    border-bottom: none;
}

/* Tlačítka */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #6d356d;
    border-color: #6d356d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 71, 137, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Formuláře */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 71, 137, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.invalid-feedback {
    display: block;
}

/* Badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Alerts */
.alert {
    border-radius: 0.375rem;
    border: none;
}

/* Footer */
footer {
    margin-top: auto;
}

/* QR kód */
.qr-code-container {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    text-align: center;
}

.qr-code-container img {
    max-width: 300px;
    height: auto;
    margin: 1rem auto;
}

/* Platební info box */
.payment-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.payment-info h3 {
    margin-bottom: 1.5rem;
}

.payment-info .payment-detail {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.payment-info .payment-detail strong {
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.payment-info .payment-detail .value {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Statistiky v admin dashboardu */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Tabulky */
.table-responsive {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(139, 71, 137, 0.05);
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-zaplaceno {
    background-color: #d4edda;
    color: #155724;
}

.status-nezaplaceno {
    background-color: #f8d7da;
    color: #721c24;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Responsive úpravy */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .payment-info {
        padding: 1rem;
    }
    
    .qr-code-container img {
        max-width: 250px;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

/* Animace */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Print styly */
@media print {
    .navbar,
    .btn,
    .alert,
    footer {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Admin sidebar */
.admin-sidebar {
    background-color: #2c3e50;
    min-height: calc(100vh - 56px);
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
}

/* Dark mode support (připraveno pro budoucnost) */
@media (prefers-color-scheme: dark) {
    /* Připraveno pro dark mode */
}
/* Oprava překrývání modalů */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Pokud je více modalů, zvýšit z-index druhého */
.modal.show ~ .modal {
    z-index: 1060;
}

.modal.show ~ .modal-backdrop {
    z-index: 1050;
}

/* Fix hlavičky na veřejné části */
body {
    padding-top: 80px;
}

/* Fix admin sidebar - musí být pod hlavičkou */
.sidebar {
    position: fixed;
    top: 80px !important; /* Posunout dolů pod hlavičku */
    bottom: 0;
    left: 0;
    z-index: 100 !important; /* Pod hlavičku (která má 1050) */
    padding: 0;
}

/* Hlavička má nejvyšší z-index */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1050 !important;
}

/* Admin main content - odsadit zleva kvůli sidebar */
body.admin main,
.container-fluid main {
    margin-left: 0;
    padding-top: 20px;
}

@media (min-width: 768px) {
    body.admin main,
    .container-fluid main {
        margin-left: 16.66667%; /* Šířka sidebaru */
    }
}

/* Oprava pro admin stránky */
.admin-layout .sidebar {
    top: 80px !important;
}

