/* Frontend CSS pro SVJ Nástěnku */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Timeline styly */
.timeline {
    position: relative;
}

.timeline-item {
    border-left: 3px solid var(--primary-color);
    margin-left: 20px;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
}

/* Fotky */
.img-fluid:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Karty hříšníků */
.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Badges pro závažnost */
.badge.bg-tezka { background-color: var(--danger-color) !important; }
.badge.bg-stredni { background-color: var(--warning-color) !important; color: #000; }
.badge.bg-lehka { background-color: var(--secondary-color) !important; }

/* Responzivní obrázky */
.modal-body img {
    max-width: 100%;
    height: auto;
}

/* Fotogalerie v příspěvcích */
.photo-gallery-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 0.375rem 0 0 0.375rem;
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: opacity 0.2s ease;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-btn-prev { left: 6px; }
.gallery-btn-next { right: 6px; }

.photo-gallery-wrapper:hover .gallery-btn {
    opacity: 1;
}

.gallery-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    pointer-events: none;
}

/* Aktivní miniatura */
.gallery-thumb {
    opacity: 0.6;
    transition: opacity 0.15s ease, outline 0.15s ease;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb-active {
    opacity: 1;
    outline: 2px solid var(--primary-color, #0d6efd);
    outline-offset: 1px;
}

/* Šipky v modalu */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 1;
    padding: 0;
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-nav-prev { left: 8px; }
.modal-nav-next { right: 8px; }

/* Navigace */
.navbar-brand {
    font-weight: bold;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
}

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

/* Statistiky sidebar */
.card-header h5 {
    margin: 0;
    font-size: 1rem;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2em;
}

/* Utility classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }

/* Mobile optimalizace */
@media (max-width: 768px) {
    .timeline-item {
        margin-left: 10px;
    }

    .timeline-item::before {
        left: -6px;
        width: 8px;
        height: 8px;
    }

    .card-body {
        padding: 1rem 0.75rem;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Optimalizace obrázků pro mobily */
    .timeline-item .row {
        flex-direction: column;
    }

    .timeline-item .col-md-4,
    .timeline-item .col-md-8 {
        flex: 0 0 auto;
        width: 100%;
    }

    .timeline-item .col-md-4 img {
        min-height: 150px !important;
        max-height: 200px;
        width: 100%;
        object-fit: cover;
    }

    .timeline-item .col-md-4 .bg-light {
        min-height: 150px !important;
    }

    /* Modal obrázky na mobilech */
    .modal-body img {
        max-width: 100%;
        height: auto;
        max-height: 80vh;
        object-fit: contain;
    }
}

/* Loading animace */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert styly */
.alert {
    border: none;
    border-radius: 8px;
}

/* Button styly */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}