* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-header h1 {
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.gallery-header p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.download-all-btn {
    background: linear-gradient(90deg, #1C251D, #5D8864);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-all-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.download-all-btn:hover:not(:disabled) {
    background: #5D8864;
    transform: translateY(-2px);
}

.download-all-btn .download-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.filter-tags {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    padding-left: 0px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.filter-tags h3 {
    margin-bottom: 15px;
    color: #1C251D;
    width: 100%;
}

.filter-tags .download-all-btn {
    margin-top: -5px;
    flex-shrink: 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: #ffffff00;
    color: #1C251D;
    border: #1C251D 1px solid ;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tag.active {
    background: linear-gradient(90deg, #1C251D, #5D8864);
    border: none;
    color: white;
}

.tag:hover {
    transform: translateY(-2px);
}

.tag-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    filter: brightness(0) saturate(100%);
}

.tag.active .tag-icon {
    filter: brightness(0) saturate(100%) invert(69%) sepia(89%) saturate(500%) hue-rotate(15deg) brightness(120%);
}

.masonry-grid {
    columns: 4;
    column-gap: 9px;
}

@media (max-width: 1200px) {
    .masonry-grid { columns: 3; }
}

@media (max-width: 768px) {
    .masonry-grid { columns: 2; }
}

@media (max-width: 480px) {
    .masonry-grid { columns: 1; }
}

.masonry-item {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 9px;
    break-inside: avoid;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.masonry-item:hover {
    transform: translateY(-2px);
}

.masonry-item img {
    width: 100%;
    border-radius: 5px;
    transition: box-shadow 0.2s ease;
}

.masonry-item:hover img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
    border-radius: 8px;
    pointer-events: none;
}

.masonry-item:hover .image-overlay {
    opacity: 1;
    pointer-events: auto;
}

.download-btn {
    background: linear-gradient(90deg, #1C251D, #5D8864);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #5D8864;
    transform: scale(1.1);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255,255,255,0.4);
}

.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.lightbox-download {
    background: linear-gradient(90deg, #1C251D, #5D8864);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-download .download-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.lightbox-download:hover {
    background: #5D8864;
}

/* Pagination Styles */
.pagination-container {
    margin: 30px auto;
    padding: 15px;
    text-align: center;
    display: none; /* Hidden by default */
    max-width: 400px;
}

.pagination-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.pagination-btn {
    background: #f8f9fa;
    color: #1C251D;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 80px;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #5D8864;
}

.pagination-btn:disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
    border-color: #eee;
}

@media (max-width: 480px) {
    .pagination-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-btn {
        min-width: 120px;
    }
}

.hidden {
    display: none !important;
}
