:root {
    --primary-color: #5b5bd6;
    /* Purple-ish color from button/logo */
    --bg-color: #f9f9f9;
    --text-color: #333;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background-color: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2rem;
}

.btn-primary-custom {
    background-color: #1a1a2e;
    /* Dark button color */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary-custom:hover {
    background-color: #333;
    color: white;
}

.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-title {
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 30px;
    color: #1a1a2e;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 30px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.filter-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    background: white;
    border: 1px solid #eee;
    padding: 8px 16px;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #eee;
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: #fff;
    font-weight: 600;
}

.filter-btn.btn-more {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.card-custom {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    background: transparent;
}

.card-custom:hover {
    transform: translateY(-5px);
}

.card-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    /* aspect-ratio removed for masonry */
}

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

.card-footer-custom {
    background: transparent;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.card-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Masonry Layout */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
    width: 100%;
}

@media (min-width: 576px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (min-width: 992px) {
    .masonry-grid {
        column-count: 4;
    }
}

/* 1200px+ stays at 4 as requested, so no need for extra query unless we want 5 later. */

.masonry-item {
    break-inside: avoid;
    page-break-inside: avoid;
    /* Firefox */
    -webkit-column-break-inside: avoid;
    /* Safari/Chrome */
    width: 100%;
    /* Ensure it fits the column */
    margin-bottom: 1.5rem;
}

/* Adjust card wrapper for masonry (variable height) */
.card-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    width: 100%;
}

.card-img-top {
    width: 100% !important;
    /* Force fit */
    height: auto;
    display: block;
}

/* Gallery Card Refactor */
.gallery-card {
    transition: transform 0.3s ease;
    border-radius: 16px;
    background: #000;
}

.gallery-card:hover {
    transform: translateY(-5px);
}

.gallery-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.gallery-user-info {
    z-index: 2;
}

.gallery-stats {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.gallery-card:hover .gallery-stats {
    opacity: 1;
    transform: translateY(0);
}

.gallery-img {
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.03);
}

.smaller {
    font-size: 0.85rem;
    font-weight: 500;
}