/* ================================================
   LPM Gallery — Modern Photo Grid
   ================================================ */

:root {
    --lpm-primary: #6c63ff;
    --lpm-primary-dark: #5a52d5;
    --lpm-dark: #1a1a2e;
    --lpm-dark2: #16213e;
    --lpm-text: #333;
    --lpm-text-light: #888;
    --lpm-border: #e8e8ef;
    --lpm-bg: #f5f5f9;
    --lpm-radius: 12px;
    --lpm-shadow: 0 4px 15px rgba(0,0,0,0.06);
    --lpm-shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
}

/* === Filters Bar === */
.lpm-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lpm-gallery-filters {
    margin-bottom: 24px;
}

.lpm-gallery-search {
    position: relative;
    margin-bottom: 12px;
    display: none;
}

.lpm-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--lpm-border);
    border-radius: var(--lpm-radius);
    font-size: 16px;
    outline: none;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.lpm-search-input:focus {
    border-color: var(--lpm-primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.lpm-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.lpm-gallery-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lpm-filter-select {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    border: 2px solid var(--lpm-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.lpm-filter-select:focus {
    border-color: var(--lpm-primary);
}

.lpm-gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: var(--lpm-text-light);
    font-size: 14px;
}

/* === Photo Grid === */
.lpm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.lpm-gallery-card {
    position: relative;
    border-radius: var(--lpm-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--lpm-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.lpm-gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--lpm-shadow-hover);
}

.lpm-gallery-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.lpm-gallery-card:hover img {
    transform: scale(1.05);
}

.lpm-gallery-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lpm-gallery-card:hover .lpm-gallery-card-overlay {
    opacity: 1;
}

.lpm-gallery-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(26, 26, 46, 0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.lpm-gallery-card-fav {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lpm-gallery-card-fav:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.15);
}

.lpm-gallery-card-info {
    padding: 14px 16px;
}

.lpm-gallery-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lpm-dark);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lpm-gallery-card-title a {
    text-decoration: none;
    color: inherit;
}

.lpm-gallery-card-title a:hover {
    color: var(--lpm-primary);
}

.lpm-gallery-card-photographer {
    font-size: 13px;
    color: var(--lpm-text-light);
}

.lpm-gallery-card-photographer a {
    color: var(--lpm-primary);
    text-decoration: none;
}

.lpm-gallery-card-meta {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--lpm-text-light);
}

/* === Loader === */
.lpm-gallery-loader {
    text-align: center;
    padding: 40px;
}

.lpm-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--lpm-border);
    border-top-color: var(--lpm-primary);
    border-radius: 50%;
    animation: lpm-spin 0.8s linear infinite;
}

@keyframes lpm-spin {
    to { transform: rotate(360deg); }
}

.lpm-gallery-actions {
    text-align: center;
    padding: 30px;
}

.lpm-load-more-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--lpm-primary), var(--lpm-primary-dark));
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.lpm-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

/* === Lightbox === */
.lpm-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lpm-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lpm-lightbox-close:hover { opacity: 1; }

.lpm-lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    text-align: center;
}

.lpm-lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.lpm-lightbox-info {
    color: #fff;
    padding: 16px;
    text-align: center;
}

.lpm-lightbox-info h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.lpm-lightbox-info p {
    margin: 0;
    color: #aaa;
    font-size: 14px;
}

.lpm-lightbox-prev,
.lpm-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.lpm-lightbox-prev:hover,
.lpm-lightbox-next:hover { background: rgba(255,255,255,0.2); }

.lpm-lightbox-prev { left: 20px; }
.lpm-lightbox-next { right: 20px; }

/* === No Results === */
.lpm-no-results {
    text-align: center;
    padding: 60px;
    color: var(--lpm-text-light);
}

.lpm-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .lpm-gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .lpm-gallery-card img { height: 160px; }
    .lpm-gallery-card-info { padding: 10px 12px; }
    .lpm-gallery-card-title { font-size: 13px; }
    .lpm-gallery-filter-row { flex-direction: column; }
    .lpm-filter-select { min-width: auto; }
    .lpm-lightbox-prev,
    .lpm-lightbox-next { display: none; }
}

@media (max-width: 480px) {
    .lpm-gallery-grid {
        grid-template-columns: 1fr;
    }
}
