@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap&subset=latin');

:root {
    --primary-color: #007bff;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --grey-color: #e0e0e0;
    --white-color: #fff;
    --shadow: 0 10px 20px rgba(0,0,0,0.1);
    /* Gradient color stops for animated light theme */
    --grad-1: #ffffff; /* soft white */
    --grad-2: #f3f8ff; /* pale blue */
    --grad-3: #eef9f1; /* pale green hint */
}

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Animated light gradient background (subtle, pleasant) */
    background: linear-gradient(120deg, var(--grad-1) 0%, var(--grad-2) 50%, var(--grad-3) 100%);
    background-size: 300% 300%;
    animation: bgShift 12s ease-in-out infinite;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
        background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
    }
}

/* Custom Scrollbar Styling */
/* Webkit browsers (Chrome, Safari, Edge) */
body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 10px;
}

body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    border: 2px solid var(--light-color);
    transition: background 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
}

body::-webkit-scrollbar-thumb:active {
    background: #003d82;
}

/* Firefox scrollbar */
body {
    scrollbar-color: var(--primary-color) var(--light-color);
    scrollbar-width: thin;
}

.container {
    max-width: 1300px;
    margin: auto;
    padding: 2rem 1rem;
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .container {
        padding: 1.2rem 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    header {
        margin-bottom: 1.8rem;
    }

    header h1 {
        font-size: 2.2rem;
        margin-bottom: 0.3rem;
    }

    header p {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    header {
        margin-bottom: 2rem;
    }

    header h1 {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }

    header p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    header {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.3rem;
        letter-spacing: 0;
    }

    header p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-button {
    background: var(--white-color);
    color: var(--dark-color);
    border: 2px solid var(--grey-color);
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-button:hover {
    background: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.filter-button:active {
    transform: scale(0.98);
}

.filter-button.active {
    background: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .filter-buttons {
        gap: 0.7rem;
        margin-bottom: 1.8rem;
    }

    .filter-button {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
        min-height: 38px;
    }
}

@media (max-width: 768px) {
    .filter-buttons {
        gap: 0.7rem;
        margin-bottom: 2rem;
    }

    .filter-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        padding: 0 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Custom scrollbar for filter buttons */
    .filter-buttons::-webkit-scrollbar {
        height: 6px;
    }

    .filter-buttons::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
    }

    .filter-buttons::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 10px;
        border: 1px solid var(--light-color);
    }

    .filter-buttons::-webkit-scrollbar-thumb:hover {
        background: #0056b3;
    }

    .filter-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 40px;
        flex-shrink: 0;
        white-space: nowrap;
    }
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    height: 250px;
    will-change: transform;
    transition: box-shadow 0.3s ease;
}

.gallery-item:active {
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 1.8rem;
    }

    .gallery-item {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .gallery-item {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .gallery-item {
        height: 180px;
    }
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0),
                linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #f0f0f0;
}

.gallery-item img.loaded {
    background: none;
}

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

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .gallery-item:hover img {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .gallery-item:hover img {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .gallery-item:hover img {
        transform: scale(1.05);
    }
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--white-color);
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .overlay {
        padding: 1.5rem 1.2rem 1.2rem;
    }
}

@media (max-width: 768px) {
    .overlay {
        padding: 1.5rem 1rem 1rem;
    }

    .gallery-item:active .overlay {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .overlay {
        padding: 1rem 0.75rem 0.75rem;
        background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    }

    .gallery-item:active .overlay {
        transform: translateY(0);
    }
}

.overlay h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Large screen optimization (1440px and above) */
@media (min-width: 1440px) {
    .overlay h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .overlay h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .overlay h3 {
        font-size: 0.9rem;
    }
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.4s;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 5px;
    animation: scaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 10px;
    }
}

.close-button, .prev-button, .next-button {
    position: absolute;
    color: var(--white-color);
    font-size: 2.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    user-select: none;
    border: none;
    min-height: 50px;
    min-width: 50px;
}

.close-button:hover, .prev-button:hover, .next-button:hover {
    background: rgba(0,0,0,0.6);
    transform: scale(1.1);
}

.close-button:active, .prev-button:active, .next-button:active {
    transform: scale(0.95);
}

.close-button {
    top: 2rem;
    right: 2rem;
}

.prev-button {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.next-button {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .close-button, .prev-button, .next-button {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        min-height: 45px;
        min-width: 45px;
    }

    .close-button {
        top: 1rem;
        right: 1rem;
    }

    .prev-button {
        left: 1rem;
    }

    .next-button {
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .close-button, .prev-button, .next-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        min-height: 40px;
        min-width: 40px;
    }

    .close-button {
        top: 0.75rem;
        right: 0.75rem;
    }

    .prev-button {
        left: 0.5rem;
        display: none;
    }

    .next-button {
        right: 0.5rem;
        display: none;
    }
}

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

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

/* Background color-shift animation for body gradient */
@keyframes bgShift {
    0% {
        background-position: 0% 50%;
        --grad-1: #ffffff;
        --grad-2: #f3f8ff;
        --grad-3: #eef9f1;
    }
    50% {
        background-position: 100% 50%;
        --grad-1: #fffef6;
        --grad-2: #f7f3ff;
        --grad-3: #f0fbff;
    }
    100% {
        background-position: 0% 50%;
        --grad-1: #ffffff;
        --grad-2: #f3f8ff;
        --grad-3: #eef9f1;
    }
}

/* Tablet optimizations (768px and below) */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
}

/* Mobile optimizations (480px and below) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
}

/* Extra small screens (360px and below) */
@media (max-width: 360px) {
    .container {
        padding: 0.75rem 0.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    header p {
        font-size: 0.75rem;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .gallery-item {
        height: 150px;
    }
}

