/* =========================================
   HLAVNÝ ŠTÝLOVÝ SÚBOR (STYLE.CSS)
   ========================================= */

/* =========================================
   1. ZÁKLADNÉ NASTAVENIA
   ========================================= */
body {
    background-image: linear-gradient(to bottom right, #FFF, #FFD7B9);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    line-height: 1.5;
    padding: 8px;
    padding-top: 48px; /* Miesto pre horné menu */
    font-size: 17px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =========================================
   TOP CEILING MENU
   ========================================= */
.top-ceiling-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1030;
    padding: 0;
}

.top-ceiling-menu .container {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

.top-ceiling-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    gap: 0;
    align-items: center;
    padding: 8px 16px 12px 16px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-right: 8px; /* Miesto od okraja */
}

.top-ceiling-link {
    color: #495f9c;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    margin: 0 0.25rem;
}

.top-ceiling-link:hover {
    color: #3a4a7a;
    background-color: rgba(73, 95, 156, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

.top-ceiling-link i {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* =========================================
   2. TYPOGRAFIA
   ========================================= */
h1 {
    font-size: 21px;
}

h2 {
    font-size: 19px;
}

h3, h5, .accordion-button {
    font-size: 16px;
}

.fs-small {
    font-size: 0.75rem; 
}

/* =========================================
   3. FARBY
   ========================================= */
/* --- Farby pozadia --- */
.bg-success-l {
    background-color: #25BE27;
}

.bg-curious-blue {
    background-color: #2593be;
}

.bg-lemon-chiffon {
    background-color: #fdffc6;
}

.bg-cummulus {
    background-color: #feffdb;
}

.bg-my-primary {
    background-color: #495f9c;
}

/* --- Farby textu --- */
.text-green {
    color: green;
}

.text-red {
    color: red;
}

.c-primary {
    color: #495f9c;
}

/* =========================================
   4. TLAČIDLÁ A ODKAZY
   ========================================= */
.btn-primary {
    background-color: #495f9c;
    border-color: #495f9c;
    color: white;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: #495f9c;
    color: #495f9c;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #3a4a7a;
    border-color: #3a4a7a;
}

a, .nav-link {
    color: #495f9c;
}

.nav-link.active {
    color: #495f9c;
}

.no-decoration {
    text-decoration: none;
}

/* Action buttons */
.action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.2s ease;
    margin-left: 5px;
    vertical-align: middle;
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.audio-btn {
    background-color: darkred;
    border-color: darkred;
    color: white;
}

.read-btn {
    background-color: cornflowerblue;
    border-color: cornflowerblue;
    color: white;
}

.btn-6rem {
    width: 6rem;
}

/* =========================================
   5. KARTY A KONTAJNERY
   ========================================= */
.card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: none;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 8px 8px 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-radius: 0 0 8px 8px !important;
}

/* Transitions pre karty */
.dashboard-card, .work-card, .audio-card, .author-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    height: 100%;
}

.dashboard-card:hover, .work-card:hover, .audio-card:hover, .author-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

/* =========================================
   6. NAVIGÁCIA A TABS
   ========================================= */
#menu {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background-color: #f8f9fa;
    transition: right 0.3s ease-in-out;
    z-index: 1050;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

#menu.show {
    right: 0;
}

.nav-tabs {
    border-bottom: none;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.nav-tabs .nav-link.active {
    border-bottom: 2px solid var(--bs-primary);
    color: var(--bs-primary);
}

.nav-tabs .nav-link:hover {
    border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.5);
}

/* =========================================
   7. JAZYKOVÉ PREPÍNAČE A VLAJKY
   ========================================= */
.language-selector {
    position: relative;
}

.language-selector .top-ceiling-link {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    outline: none;
}

.language-selector .top-ceiling-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(73, 95, 156, 0.25);
}

.language-selector .flag {
    width: 20px;
    height: 13px;
    margin-right: 6px;
    border-radius: 2px;
    object-fit: cover;
}

.language-selector .language-code {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 2px;
}

.language-selector .dropdown-menu {
    min-width: 120px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
    padding: 4px 0;
    margin-top: 4px;
}

.language-selector .dropdown-item {
    padding: 6px 12px;
    color: #495f9c;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.language-selector .dropdown-item:hover {
    background-color: rgba(73, 95, 156, 0.1);
    color: #3a4a7a;
}

.language-selector .dropdown-item .flag {
    width: 18px;
    height: 12px;
    margin-right: 8px;
    border-radius: 2px;
}

.language-selector .dropdown-item .language-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.language-selector .flag {
    width: 24px;
    height: 16px;
    margin-right: 5px;
}

.flag {
    width: 48px;
    height: 21px;
    margin-right: 6px;
}

.language-selection {
    margin-bottom: 1.5rem;
}

/* =========================================
   8. KOMPONENTY DIEL - spoločné pre karty aj tabuľku
   ========================================= */
/* Rating a hodnotenia */
.rating-stars {
    color: #ffc107;
}

.adult-badge {
    background-color: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Názov diela, autor a excerpty */
.work-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.work-excerpt {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-stats {
    font-size: 0.9rem;
    color: #666;
    margin-left: 0.75rem;
    white-space: nowrap;
}

.author-bio {
    font-size: 0.9rem;
    color: #444;
    margin-top: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.author-stats {
    font-size: 0.95rem;
    color: #666;
}

/* =========================================
   9. FILTROVANIE A VYHĽADÁVANIE
   ========================================= */
.filter-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #495f9c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Tagy */
.tag-badge, .content-tag {
    font-size: 0.8rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    background-color: #e9ecef;
    color: #495057;
    transition: all 0.2s;
}

.tag-badge:hover, .content-tag:hover {
    background-color: #6c757d;
    color: #fff;
    transform: translateY(-2px);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 0;
}

.tag-item {
    margin: 0.5rem;
    transition: transform 0.1s;
}

.tag-item:hover {
    transform: scale(1.08);
}

.tag-size-1 { font-size: 0.8rem; }
.tag-size-2 { font-size: 0.9rem; }
.tag-size-3 { font-size: 1rem; }
.tag-size-4 { font-size: 1.2rem; }
.tag-size-5 { font-size: 1.4rem; }

/* Select2 custom styling */
.select2-container--bootstrap-5 .select2-selection {
    border-color: #ced4da;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #ced4da;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #495f9c;
    border-color: #3f5285;
    color: white;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.7);
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: white;
    background-color: rgba(0, 0, 0, 0.2);
}

/* =========================================
   10. SEKCIE DASHBOARDU A HLAVIČKY
   ========================================= */
.dashboard-section {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title .title-icon {
    margin-right: 0.5rem;
    color: #4B6C80;
}

.see-all {
    margin-left: auto;
    font-size: 0.9rem;
}

/* =========================================
   11. STRÁNKOVANIE
   ========================================= */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.pagination {
    --bs-pagination-color: #495f9c;
    --bs-pagination-hover-color: #3a4a7a;
    --bs-pagination-focus-color: #3a4a7a;
    --bs-pagination-active-bg: #495f9c;
    --bs-pagination-active-border-color: #495f9c;
}

.pagination .page-item:not(.active) .page-link {
    background-color: #fff;
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    box-shadow: 0 2px 5px rgba(73, 95, 156, 0.3);
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.pagination .page-link {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin: 0 0.15rem;
    border: 1px solid rgba(73, 95, 156, 0.2);
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Animácia pre aktívne prvky */
.pagination .page-item.active .page-link {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(73, 95, 156, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(73, 95, 156, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(73, 95, 156, 0);
    }
}

/* =========================================
   12. POMOCNÉ TRIEDY
   ========================================= */
.w-100 {
    width: 100%;
}

.w300px {
    width: 33rem;
}

/* =========================================
   13. RESPONZÍVNY DIZAJN
   ========================================= */
@media (max-width: 576px) {
    body {
        padding-top: 40px; /* Menšie miesto pre horné menu na mobile */
    }
    
    .top-ceiling-nav {
        padding: 6px 12px 10px 12px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        margin-right: 4px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    }
    
    .top-ceiling-link {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        gap: 0.2rem;
        margin: 0 0.15rem;
    }
    
    .top-ceiling-link i {
        font-size: 0.7rem;
    }
    
    /* Language selector responsive */
    .language-selector .flag {
        width: 16px;
        height: 11px;
        margin-right: 4px;
    }
    
    .language-selector .language-code {
        font-size: 0.7rem;
        margin-left: 1px;
    }
    
    .language-selector .dropdown-menu {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .language-selector .dropdown-item {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .language-selector .dropdown-item .flag {
        width: 14px;
        height: 9px;
        margin-right: 6px;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .pagination .page-item.mobile-hidden {
        display: none;
    }

    .pagination-info {
        font-size: 0.8rem;
    }

    .pagination-container {
        margin: 0.5rem 0;
    }
    
    .work-stats-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    .work-stats {
        margin-right: 0.75rem;
        white-space: nowrap;
        font-size: 0.8rem;
    }
    
    .filter-section {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        flex-wrap: wrap;
    }
    
    .see-all {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        text-align: right;
    }
}

/* Kontajner pre tagy */
.tags-container {
    position: relative;
    max-height: 48px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Rozbalený kontajner */
.tags-container.expanded {
    max-height: 500px; /* Dostatočne veľká hodnota pre všetok obsah */
}

/* Gradient prekrytie */
/* Gradient prekrytie - agresívnejšie */
.tags-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 40%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    display: block;
}

/* Skrytie gradientu pri rozbalení */
.tags-container.expanded .tags-gradient {
    display: none;
}

/* Tlačidlo pre rozbalenie/zbalenie s Bootstrap ikonami */
.btn-toggle-tags {
    position: absolute;
    top: 5px;
    right: 5px;
    border: none;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    font-size: 14px;
    transition: transform 0.3s;
}

/* Rotácia ikony pri rozbalení */
.tags-container.expanded + .btn-toggle-tags i {
    transform: rotate(180deg);
}

.content-tag { color:white; }
