/* ========== Image Cards ========== */
.image-card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.image-container {
    height: 350px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: filter 0.2s;
}

.image-container img:hover {
    filter: brightness(0.95);
}

/* ========== Thumb Vote Buttons ========== */
.thumb-vote-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.image-container:hover .thumb-vote-overlay {
    opacity: 1;
}

.thumb-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thumb-up {
    background: #28a745;
    color: white;
}

.thumb-up:hover {
    background: #218838;
    transform: scale(1.1);
}

.thumb-down {
    background: #dc3545;
    color: white;
}

.thumb-down:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ========== Lightbox Styles ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

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

.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease-in-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 10001;
}

/* ========== Lightbox Thumb Buttons ========== */
.lightbox-thumb-group {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 10001;
}

.lightbox-thumb-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.lightbox-thumb-up {
    background: #28a745;
    color: white;
}

.lightbox-thumb-up:hover {
    background: #218838;
    transform: scale(1.15);
}

.lightbox-thumb-down {
    background: #dc3545;
    color: white;
}

.lightbox-thumb-down:hover {
    background: #c82333;
    transform: scale(1.15);
}

.lightbox-vote-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: none;
}

.lightbox-vote-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* ========== General Styles ========== */
.vote-btn {
    transition: all 0.2s;
}

.vote-btn:hover {
    transform: scale(1.1);
}

.vote-count {
    font-weight: bold;
    color: #007bff;
}

.folder-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.navbar-brand {
    font-weight: bold;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* ========== Collapsible Kategorien ========== */
#mainCategoryToggle {
    transition: all 0.3s ease;
    border-color: #007bff;
}

#mainCategoryToggle:hover {
    background-color: #e7f1ff;
    border-color: #0056b3;
}

#mainCategoryList {
    animation: slideDown 0.3s ease-out;
    border: 1px solid #dee2e6;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
}

#mainCategoryList[style*="display: none"] {
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
}

.form-check {
    padding: 8px 0;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

#toggleIcon {
    transition: transform 0.3s ease;
}

#selectedMainCatDisplay {
    animation: fadeIn 0.3s ease-in;
}

/* ========== Mobile Responsive ========== */
@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 0;
    }
    
    .lightbox-container {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .lightbox-image {
        max-height: 100vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    .lightbox-info {
        bottom: 10px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .lightbox-thumb-group {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .lightbox-thumb-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .image-container {
        height: 250px;
    }
}

@media (max-width: 1200px) {
    .image-container {
        height: 300px;
    }
}

/* ========== Star Rating System ========== */
.star-rating {
    display: flex;
    gap: 4px;
}

.star-rating .star {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
}

.star-rating .star:hover,
.star-rating .star.hover {
    color: #ffd700;
    transform: scale(1.1);
}

.star-rating .star.active {
    color: #ffd700;
}

.star-rating .star.active.temp {
    color: #ffed4a;
}

/* ========== Enhanced Radio Button Cards ========== */
.hover-highlight {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    background: #f8f9fa;
}

.hover-highlight:hover {
    background: #e3f2fd;
    border-color: #1976d2 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
}

.hover-highlight:has(.form-check-input:checked) {
    background: #e8f5e8;
    border-color: #28a745 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.hover-highlight .form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.hover-highlight .form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: color 0.2s;
}

.hover-highlight:hover .form-check-label {
    color: #1976d2;
}

.hover-highlight:has(.form-check-input:checked) .form-check-label {
    color: #28a745;
    font-weight: 600;
}

/* User select none for labels */  
.user-select-none {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ========== Category Cards ========== */
.category-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6 !important;
    background-color: #ffffff;
}

.category-card:hover {
    border-color: #0d6efd !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.category-card.selected {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.category-card.selected i {
    color: white !important;
}

.category-card.selected .fw-bold,
.category-card.selected .small {
    color: white !important;
}

/* Container improvements for modals */
.modal-xl .container-fluid {
    max-width: 100%;
}

.modal-body .form-label {
    font-weight: 600;
    color: #495057;
}

.modal-body .form-label i {
    color: #6c757d;
    margin-right: 8px;
}
/* ========== Mobile Optimizations for Accordions ========== */

/* Category Images Gallery - Responsive Grid */
.category-images-gallery {
    display: grid !important;
    gap: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* Mobile: 2 columns */
@media (max-width: 480px) {
    .category-images-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
        padding: 8px;
    }
    
    .category-image-item {
        font-size: 0.75rem !important;
    }
    
    .category-image-item img {
        height: 70px !important;
    }
    
    /* Hide less important table columns on extra small screens */
    .table.table-sm thead th:nth-child(2),
    .table.table-sm thead th:nth-child(3),
    .table.table-sm tbody td:nth-child(2),
    .table.table-sm tbody td:nth-child(3) {
        font-size: 0.75rem;
        padding: 0.35rem 0.2rem;
    }
}

/* Tablet: 3-4 columns */
@media (min-width: 481px) and (max-width: 768px) {
    .category-images-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
    }
    
    .table.table-sm {
        font-size: 0.85rem;
    }
}

/* Desktop: 4+ columns */
@media (min-width: 769px) {
    .category-images-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 10px;
    }
}

/* Category Image Items */
.category-image-item {
    text-align: center;
    padding: 8px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 5px;
    flex-grow: 1;
}

@media (max-width: 480px) {
    .category-image-item img {
        height: 70px;
    }
}

/* Accordion Table - Responsive Design */
.table.table-sm tr {
    border-bottom: 1px solid #dee2e6;
}

/* Desktop: Table layout */
@media (min-width: 768px) {
    .table.table-sm {
        font-size: 0.95rem;
    }
    
    .table.table-sm th,
    .table.table-sm td {
        padding: 0.75rem;
        vertical-align: middle;
    }
}

/* Tablet: condensed table */
@media (max-width: 768px) {
    .table.table-sm {
        font-size: 0.85rem;
    }
    
    .table.table-sm th,
    .table.table-sm td {
        padding: 0.5rem 0.25rem;
    }
}

/* Mobile: Card-based layout */
@media (max-width: 576px) {
    /* Hide table header */
    .table.table-sm thead {
        display: none;
    }
    
    /* Convert rows to cards */
    .table.table-sm tbody tr:not(.category-images-row) {
        display: block;
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        background-color: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    /* Style table cells as blocks with labels */
    .table.table-sm tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        font-size: 0.85rem;
    }
    
    /* Add labels before cells */
    .table.table-sm tbody td:nth-child(2)::before {
        content: "Bilder: ";
        font-weight: 600;
        color: #6c757d;
        margin-right: 8px;
    }
    
    .table.table-sm tbody td:nth-child(3)::before {
        content: "Votes: ";
        font-weight: 600;
        color: #6c757d;
        margin-right: 8px;
    }
    
    .table.table-sm tbody td:nth-child(4)::before {
        content: "Ø Bewertung: ";
        font-weight: 600;
        color: #6c757d;
        margin-right: 8px;
    }
    
    .table.table-sm tbody td:nth-child(5)::before {
        content: "Bereich: ";
        font-weight: 600;
        color: #6c757d;
        margin-right: 8px;
    }
    
    /* First cell (category name) stays as is */
    .table.table-sm tbody td:first-child {
        display: block;
        padding: 0 0 8px 0;
        border-bottom: 1px solid #e9ecef;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    .table.table-sm tbody td:first-child::before {
        content: none;
    }
    
    /* Button takes full width */
    .table.table-sm tbody td:last-child {
        display: block;
        padding: 8px 0 0 0;
        margin-top: 8px;
        border-top: 1px solid #e9ecef;
    }
    
    .table.table-sm tbody td:last-child::before {
        content: none;
    }
    
    /* Badges on mobile */
    .badge {
        font-size: 0.7rem;
        padding: 0.35em 0.65em;
    }
    
    /* Full width buttons */
    .table.table-sm .btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Hide long text on mobile */
    .text-muted {
        display: block;
        font-size: 0.8rem;
    }
    
    /* Make images row visible with proper styling */
    .table.table-sm tbody tr.category-images-row {
        display: table-row;
        padding: 0;
        margin-bottom: 0;
        border: none;
        background-color: transparent;
        box-shadow: none;
        border-top: 2px solid #dee2e6;
    }
    
    .table.table-sm tbody tr.category-images-row td {
        display: block;
        padding: 12px 0;
        border: none;
    }
}