/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d546d;
    background-color: #ffffff;
}

body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0f354d 0%, #2d546d 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-logo {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.header-logo a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.header-logo a:hover {
    transform: scale(1.10);
}

.logo {
    max-height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.9));
    transition: filter 0.3s ease;
}

.header-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Main Content */
.main {
    padding: 4rem 0;
    min-height: 80vh;
}

/* Controls (filtry i sortowanie) */
.controls {
    margin-bottom: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 53, 77, 0.1);
}

.controls h3 {
    color: #0f354d;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.filters, .sorting {
    margin-bottom: 2rem;
}

.sorting:last-child {
    margin-bottom: 0;
}

.filter-buttons, .sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn, .sort-btn {
    padding: 0.7rem 1.2rem;
    background: white;
    color: #2d546d;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    font-size: 0.9rem;
}

.filter-btn:hover, .sort-btn:hover {
    background: #0f354d;
    color: white;
    border-color: #0f354d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 53, 77, 0.2);
}

.filter-btn.active, .sort-btn.active {
    background: #0f354d;
    color: white;
    border-color: #0f354d;
    box-shadow: 0 4px 12px rgba(15, 53, 77, 0.2);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 53, 77, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(15, 53, 77, 0.15);
}

.image-container {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: block;
}

.gallery-image:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.gallery-image::after {
    content: '👁️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.image-container:hover .gallery-image::after {
    opacity: 1;
}

.item-info {
    padding: 1.5rem;
}

.item-info h3 {
    color: #0f354d;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.description {
    color: #2d546d;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.meta .category {
    background: #0f354d;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.meta .views {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Album Indicators */
.album-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.photo-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Album Thumbnails */
.album-thumbnails {
    margin-top: 1rem;
}

.thumbnails-list {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.thumbnail {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    border-color: #0f354d;
    transform: scale(1.1);
}

.more-indicator {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: #0f354d;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 1rem;
}

.admin-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid white;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.admin-link:hover {
    background: white;
    color: #0f354d;
}

/* Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    background: linear-gradient(45deg, #f8f9fa 25%, #e9ecef 25%, #e9ecef 50%, #f8f9fa 50%, #f8f9fa 75%, #e9ecef 75%, #e9ecef);
    background-size: 20px 20px;
}

img.loading {
    opacity: 0.3;
}

img.loaded {
    opacity: 1;
    background: none;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #333333;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Paginacja */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 50px 0 30px 0;
    flex-wrap: wrap;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(15, 53, 77, 0.08);
    animation: fadeInUp 0.6s ease-out;
}

.pagination-btn {
    padding: 12px 18px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #2d546d;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 48px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.pagination-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(15, 53, 77, 0.1), transparent);
    transition: left 0.5s ease;
}

.pagination-btn:hover::before {
    left: 100%;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #0f354d;
    color: #0f354d;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(15, 53, 77, 0.2);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #0f354d 0%, #2d546d 100%);
    color: white;
    border-color: #0f354d;
    box-shadow: 0 6px 20px rgba(15, 53, 77, 0.3);
    transform: translateY(-2px);
}

.pagination-btn.active:hover {
    background: linear-gradient(135deg, #2d546d 0%, #0f354d 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 53, 77, 0.35);
}

.pagination-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}

.pagination-btn:first-child,
.pagination-btn:last-child {
    padding: 12px 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.pagination-btn:first-child:hover,
.pagination-btn:last-child:hover {
    background: linear-gradient(135deg, #0f354d 0%, #2d546d 100%);
    color: white;
}

.pagination-btn:disabled,
.pagination-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.pagination-btn:disabled:hover {
    background: white;
    border-color: #e9ecef;
    color: #2d546d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    padding: 1rem 1.5rem;
    background: #000000;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lightbox-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

.lightbox-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: #333333;
    color: #ffffff;
}

.lightbox-body {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 400px;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
    max-height: 70vh;
    padding: 20px;
    background: #000;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.3s ease;
    display: block;
    margin: 0 auto;
}

.lightbox-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.lightbox-loading.hidden {
    display: none;
}

.lightbox-loading .loading {
    position: relative;
    z-index: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #0f354d;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lightbox-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.lightbox-counter {
    font-weight: 600;
    color: #0f354d;
    font-size: 0.9rem;
}

.lightbox-description {
    color: #6c757d;
    font-size: 0.9rem;
    flex: 1;
    text-align: left;
    line-height: 1.4;
}

.lightbox-description strong {
    color: #0f354d;
}

/* Lightbox Thumbnails */
.lightbox-thumbs-container {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.lightbox-thumbs {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    min-height: 70px;
}

.lightbox-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.lightbox-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-thumb.active {
    border-color: #0f354d;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(15, 53, 77, 0.3);
}

.lightbox-thumb-skeleton {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Admin Panel */
.admin-panel {
    background: #f8f9fa;
    min-height: 100vh;
}

.admin-header {
    background: #0f354d;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.admin-nav {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.admin-nav a {
    color: #2d546d;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.admin-nav a:hover, .admin-nav a.active {
    background: #0f354d;
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #0f354d;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0f354d;
    box-shadow: 0 0 0 3px rgba(15, 53, 77, 0.1);
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #0f354d;
    color: white;
}

.btn-primary:hover {
    background: #2d546d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 53, 77, 0.2);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.admin-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #0f354d;
}

.admin-table img {
    max-width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(15, 53, 77, 0.1);
}

.login-form h2 {
    text-align: center;
    color: #0f354d;
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.drop-zone {
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #0f354d;
    background: rgba(15, 53, 77, 0.05);
}

.drop-zone p {
    margin: 0;
    color: #6c757d;
}

.preview-container {
    display: none;
    margin-top: 1rem;
}

.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Optymalizacje dla urządzeń dotykowych */
@media (hover: none) and (pointer: coarse) {
    .gallery-image:hover {
        transform: none;
        filter: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .image-container:hover .gallery-image::after {
        opacity: 0;
    }
    
    .gallery-image {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Desktop - miniaturki pod zdjęciem na czarnym tle */
@media (min-width: 769px) {
    .lightbox-footer .lightbox-thumbs-container {
        display: none;
    }
    
    .lightbox-body {
        flex-direction: column;
    }
    
    .lightbox-image-container {
        background: #000000;
        min-height: 500px;
        max-height: 70vh;
        padding: 20px;
        width: 100%;
    }
    
    .lightbox-image {
        max-height: 70vh;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
    
    .lightbox-thumbs-container {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px 0;
        background: #1a1a1a;
        border-top: 1px solid #333;
        width: 100%;
        order: 3;
    }
    
    .lightbox-thumbs {
        display: flex;
        gap: 8px;
        max-width: 60%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 15px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        margin: 0 auto;
        min-height: 80px;
    }
    
    .lightbox-thumbs::-webkit-scrollbar {
        height: 8px;
    }
    
    .lightbox-thumbs::-webkit-scrollbar-track {
        background: #2a2a2a;
        border-radius: 4px;
        margin: 0 15px;
    }
    
    .lightbox-thumbs::-webkit-scrollbar-thumb {
        background: #0f354d;
        border-radius: 4px;
        transition: background 0.3s ease;
    }
    
    .lightbox-thumbs::-webkit-scrollbar-thumb:hover {
        background: #2d546d;
    }
    
    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }
}

/* Responsywność Desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .image-container {
        height: 260px;
    }
    
    .lightbox-thumbs {
        max-width: 65%;
    }
}

@media (min-width: 1024px) {
    .lightbox-thumb,
    .lightbox-thumb-skeleton {
        width: 90px;
        height: 68px;
        flex-shrink: 0;
        border: 2px solid #333;
    }
    
    .lightbox-thumb.active {
        border-color: #0f354d;
    }
    
    .lightbox-thumb {
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .lightbox-thumb:hover {
        transform: scale(1.1);
        z-index: 2;
        border-color: #2d546d;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .lightbox-thumbs {
        max-width: 55%;
    }
    
    .lightbox-image-container {
        max-height: 75vh;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
    
    .lightbox-thumb,
    .lightbox-thumb-skeleton {
        width: 100px;
        height: 75px;
    }
    
    .lightbox-title {
        font-size: 1.4rem;
    }
}

@media (min-width: 1920px) {
    .lightbox-thumbs {
        max-width: 50%;
    }
    
    .lightbox-image-container {
        max-height: 80vh;
    }
    
    .lightbox-image {
        max-height: 80vh;
    }
}

@media (min-width: 2560px) {
    .lightbox-thumbs {
        max-width: 40%;
    }
}

/* Mobile - fullscreen lightbox z czarnym motywem */
@media (max-width: 768px) {
    .container {
        padding: 0 8px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .header-logo {
        margin-bottom: 0.8rem;
    }
    
    .logo {
        max-height: 70px;
    }
    
    .header-title {
        font-size: 1.6rem;
        margin-bottom: 0.3rem;
    }
    
    .header-subtitle {
        font-size: 0.85rem;
    }
    
    .main {
        padding: 1.5rem 0;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-top: 1rem;
    }
    
    .image-container {
        height: 300px;
    }
    
    .gallery-image {
        object-fit: cover;
    }
    
    .controls {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .controls h3 {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .filters, .sorting {
        margin-bottom: 1rem;
    }
    
    .filter-buttons, .sort-buttons {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .filter-btn, .sort-btn {
        text-align: center;
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }
    
    .item-info {
        padding: 1rem;
    }
    
    .item-info h3 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }
    
    .description {
        font-size: 0.88rem;
        line-height: 1.5;
    }
    
    .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .footer {
        margin-top: 2rem;
        padding: 1.2rem 0;
    }
    
    .pagination {
        gap: 6px;
        padding: 15px;
        margin: 40px 0 20px 0;
    }
    
    .pagination-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
        min-width: 42px;
    }
    
    .pagination-btn:first-child,
    .pagination-btn:last-child {
        padding: 10px 18px;
    }
    
    .admin-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.7rem 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Lightbox fullscreen */
    .lightbox {
        padding: 0;
        align-items: stretch;
        background: rgba(0, 0, 0, 0.98);
    }
    
    .lightbox-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        background: #000000;
    }
    
    .lightbox-header {
        position: sticky;
        top: 0;
        padding: 0.8rem 1rem;
        background: #000000;
        border-bottom: 1px solid #333;
        z-index: 100;
        flex-shrink: 0;
    }
    
    .lightbox-title {
        font-size: 0.95rem;
        color: #ffffff;
        margin: 0;
    }
    
    .lightbox-close {
        color: #ffffff;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
        background: none;
    }
    
    .lightbox-close:hover {
        background: #333333;
    }
    
    .lightbox-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        background: #000000;
    }
    
    .lightbox-image-container {
        background: #000000;
        min-height: 60vh;
        max-height: none;
        padding: 10px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }
    
    .lightbox-image {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        background: rgba(0, 0, 0, 0.7);
        color: #ffffff;
        border: 1px solid #333;
    }
    
    .lightbox-nav:hover {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-thumbs-container {
        display: flex;
        padding: 8px 10px;
        background: #000000;
        border-top: 1px solid #333;
        flex-shrink: 0;
    }
    
    .lightbox-thumbs {
        max-width: 100%;
        gap: 6px;
        padding: 3px 0;
        min-height: 50px;
    }
    
    .lightbox-thumb,
    .lightbox-thumb-skeleton {
        width: 60px;
        height: 45px;
        border: 2px solid #333;
    }
    
    .lightbox-thumb.active {
        border-color: #0f354d;
    }
    
    .lightbox-footer {
        position: sticky;
        bottom: 0;
        padding: 0.6rem 1rem;
        background: #000000;
        border-top: 1px solid #333;
        z-index: 100;
        flex-shrink: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.8rem;
        min-height: auto;
    }
    
    .lightbox-counter {
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .lightbox-description {
        color: #cccccc;
        font-size: 0.8rem;
        text-align: right;
        line-height: 1.3;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .lightbox-description strong {
        color: #ffffff;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 6px;
    }
    
    .header {
        padding: 1.2rem 0;
    }
    
    .main {
        padding: 1.2rem 0;
    }
    
    .gallery {
        gap: 0.6rem;
    }
    
    .image-container {
        height: 320px;
    }
    
    .gallery-image {
        object-fit: cover;
        object-position: center;
    }
    
    .logo {
        max-height: 80px;
    }
    
    .item-info {
        padding: 1rem;
    }
    
    .filter-btn, .sort-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .pagination {
        gap: 4px;
        padding: 12px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 38px;
    }
    
    .pagination-btn:first-child,
    .pagination-btn:last-child {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .pagination-btn:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
    
    .lightbox-header {
        padding: 0.7rem 0.8rem;
    }
    
    .lightbox-title {
        font-size: 0.85rem;
    }
    
    .lightbox-close {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }
    
    .lightbox-image-container {
        min-height: 65vh;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .lightbox-thumb,
    .lightbox-thumb-skeleton {
        width: 55px;
        height: 40px;
    }
    
    .lightbox-footer {
        padding: 0.5rem 0.8rem;
        gap: 0.6rem;
    }
    
    .lightbox-counter {
        font-size: 0.8rem;
    }
    
    .lightbox-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }
}