:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --dark-color: #212529;
    --light-bg: #f8f9fa;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ========== NAVBAR ========== */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff !important;
}

/* ========== SKELETON LOADING ========== */
.skeleton-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    height: 220px;
}

.skeleton-img {
    width: 100%;
    height: 140px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    padding: 12px;
    height: 40px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin: 0;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========== FOLDER CARDS ========== */
.folder-card {
    background: white;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.folder-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.folder-card .card-img-top {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.folder-card .card-body {
    padding: 16px;
}

.folder-card .card-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-card .card-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ========== GALLERY SECTION ========== */
#gallerySection {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ========== MAIN IMAGE ========== */
.main-image-wrapper {
    position: relative;
    width: 100%;
}

#mainImageContainer {
    position: relative;
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
}

#mainImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ========== SPINNER OVERLAY ========== */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

.spinner-overlay.active {
    display: flex;
}

.spinner-border {
    width: 50px;
    height: 50px;
}

/* ========== NAVIGATION ARROWS ========== */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 5;
}

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

.nav-btn-left {
    left: 12px;
}

.nav-btn-right {
    right: 12px;
}

/* ========== IMAGE INFO ========== */
.image-info {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
}

#imageCounter {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* ========== THUMBNAILS ========== */
.thumbnails-wrapper {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 16px;
}

.thumbnails-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
}

.thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.thumbnails-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.thumbnail {
    min-width: 80px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary-color);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
}

/* ========== BACK BUTTON ========== */
#backBtn {
    cursor: pointer;
}

#backBtn:hover {
    background-color: #6c757d;
    color: white;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .gallery-container {
        padding: 16px;
    }

    #mainImageContainer {
        max-height: 400px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .thumbnail {
        min-width: 70px;
        width: 70px;
        height: 70px;
    }

    .container-fluid {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    #mainImageContainer {
        max-height: 300px;
    }

    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        top: auto;
        bottom: 12px;
    }

    .nav-btn-left {
        left: 12px;
    }

    .nav-btn-right {
        left: 60px;
    }

    .thumbnail {
        min-width: 60px;
        width: 60px;
        height: 60px;
    }

    .gallery-container {
        padding: 12px;
    }
}

/* ========== SWAL2 CUSTOM STYLE ========== */
.swal2-popup {
    border-radius: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.swal2-title {
    font-weight: 600;
    color: var(--dark-color);
}

.swal2-html-container {
    color: #666;
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
