/* Variables */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #e1e1e1;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --border-radius: 8px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}

header p {
    color: #666;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: center;
    justify-content: space-between;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.category-filters {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.sort-options select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
}

/* Gallery Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.gallery-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.gallery-item-inner {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay i {
    color: white;
    font-size: 2rem;
}

.gallery-item-info {
    padding: var(--spacing-md);
}

.gallery-item-info h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.category {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    transition: var(--transition);
}

.lightbox-caption {
    position: absolute;
    bottom: -2rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    padding: var(--spacing-sm);
}

.lightbox-info {
    position: absolute;
    bottom: -4rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    color: white;
    font-size: 0.9rem;
}

.lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-zoom-in,
.lightbox-zoom-out,
.lightbox-rotate,
.lightbox-fullscreen,
.lightbox-download {
    bottom: 20px;
}

.lightbox-zoom-in { right: 180px; }
.lightbox-zoom-out { right: 140px; }
.lightbox-rotate { right: 100px; }
.lightbox-fullscreen { right: 60px; }
.lightbox-download { right: 20px; }

/* Footer */
footer {
    text-align: center;
    padding: var(--spacing-lg);
    background: white;
    margin-top: var(--spacing-lg);
}

.footer-bottom {
    color: var(--text-color);
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .category-filters {
        justify-content: center;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .lightbox-zoom-in,
    .lightbox-zoom-out,
    .lightbox-rotate,
    .lightbox-fullscreen,
    .lightbox-download {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }

    header h1 {
        font-size: 2rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }
}