/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  Zaffer Cloud — Professional Gallery System                         ║
   ║  SaaS-inspired design — Apple / Stripe / Linear aesthetics          ║
   ╚═══════════════════════════════════════════════════════════════════════╝ */

/* ═══════════ CSS Variables ═══════════ */
:root {
    --gp-bg: #f8fafc;
    --gp-card: #ffffff;
    --gp-border: rgba(0,0,0,0.06);
    --gp-text1: #0f172a;
    --gp-text2: #475569;
    --gp-text3: #94a3b8;
    --gp-accent: #6366f1;
    --gp-accent2: #4f46e5;
    --gp-accent-glow: rgba(99,102,241,0.15);
    --gp-glass: rgba(255,255,255,0.72);
    --gp-glass-border: rgba(255,255,255,0.18);
    --gp-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --gp-shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --gp-shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --gp-shadow-xl: 0 20px 60px rgba(0,0,0,0.14);
    --gp-radius: 16px;
    --gp-radius-lg: 24px;
    --gp-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════ Gallery Section ═══════════ */
.gp-section {
    padding: 80px 0 100px;
    background: var(--gp-bg);
    position: relative;
    overflow: hidden;
}
.gp-section::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.06), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.gp-section::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,0.05), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ═══════════ Toolbar — Glassmorphism ═══════════ */
.gp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    margin: 32px 0 28px;
    background: var(--gp-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--gp-glass-border);
    border-radius: var(--gp-radius-lg);
    box-shadow: var(--gp-shadow-md);
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

/* ═══ Device Filter Tabs ═══ */
.gp-device-tabs {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.gp-device-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--gp-text3);
    transition: all var(--gp-transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.gp-device-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--gp-accent), var(--gp-accent2));
    opacity: 0;
    transition: opacity var(--gp-transition);
}

.gp-device-tab i {
    font-size: 18px;
    transition: transform var(--gp-transition);
    position: relative;
    z-index: 1;
}

.gp-device-tab span {
    position: relative;
    z-index: 1;
}

.gp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 7px;
    border-radius: 8px;
    background: rgba(0,0,0,0.04);
    font-size: 11px;
    font-weight: 800;
    color: var(--gp-text3);
    transition: all var(--gp-transition);
    position: relative;
    z-index: 1;
}

.gp-device-tab:hover {
    color: var(--gp-accent);
    border-color: rgba(99,102,241,0.2);
    background: rgba(99,102,241,0.04);
    transform: translateY(-1px);
}
.gp-device-tab:hover i { transform: scale(1.12); }

.gp-device-tab.active {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}
.gp-device-tab.active::before { opacity: 1; }
.gp-device-tab.active .gp-tab-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.gp-device-tab.active i { transform: scale(1.1); }

/* ═══ Search Bar ═══ */
.gp-search-wrap {
    position: relative;
    flex: 0 1 320px;
    min-width: 200px;
}

.gp-search-wrap i.gp-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gp-text3);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.3s;
}

.gp-search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gp-text1);
    transition: all var(--gp-transition);
    outline: none;
}

.gp-search-input::placeholder {
    color: var(--gp-text3);
    font-weight: 400;
}

.gp-search-input:focus {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: #fff;
}

.gp-search-input:focus + .gp-search-icon {
    color: var(--gp-accent);
}

.gp-search-clear {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.06);
    color: var(--gp-text3);
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.gp-search-clear:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.gp-search-clear.visible { display: flex; }

/* ═══ Results Counter ═══ */
.gp-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 20px;
    min-height: 28px;
}

.gp-results-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--gp-text3);
}
.gp-results-count strong {
    color: var(--gp-accent);
    font-weight: 800;
}

.gp-no-results {
    text-align: center;
    padding: 60px 20px;
    display: none;
}
.gp-no-results.visible { display: block; }
.gp-no-results i {
    font-size: 48px;
    color: var(--gp-text3);
    margin-bottom: 16px;
    opacity: 0.4;
}
.gp-no-results h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-text2);
    margin-bottom: 6px;
}
.gp-no-results p {
    font-size: 14px;
    color: var(--gp-text3);
}

/* ═══════════ Gallery Grid ═══════════ */
.gp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    position: relative;
}

.gp-grid[data-device="mobile"],
.gp-grid[data-device="ipad"] {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ═══ Gallery Card ═══ */
.gp-card {
    background: var(--gp-card);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--gp-transition);
    position: relative;
    opacity: 1;
    transform: scale(1);
}

.gp-card.gp-hidden {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
}

.gp-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--gp-shadow-xl);
    border-color: rgba(99,102,241,0.15);
}

/* ═══ Card Image ═══ */
.gp-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.gp-grid[data-device="mobile"] .gp-card-img,
.gp-grid[data-device="ipad"] .gp-card-img {
    aspect-ratio: 9/18;
}
.gp-grid[data-device="ipad"] .gp-card-img {
    aspect-ratio: 3/4;
    border-bottom: 3px solid rgba(99,102,241,0.1);
}

.gp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.gp-card:hover .gp-card-img img {
    transform: scale(1.06);
}

/* ═══ Card Overlay on Hover ═══ */
.gp-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15,23,42,0.7) 0%,
        rgba(15,23,42,0.1) 50%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--gp-transition);
}

.gp-card:hover .gp-card-overlay { opacity: 1; }

.gp-card-zoom {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gp-card:hover .gp-card-zoom {
    transform: translate(-50%, -50%) scale(1);
}

/* ═══ Card Caption ═══ */
.gp-card-caption {
    padding: 14px 18px 16px;
}

.gp-card-caption h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gp-text1);
    margin: 0 0 4px;
    line-height: 1.4;
    transition: color 0.3s;
}

.gp-card:hover .gp-card-caption h5 {
    color: var(--gp-accent);
}

.gp-card-caption p {
    font-size: 12.5px;
    color: var(--gp-text3);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════ LIGHTBOX / MODAL ═══════════ */
.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.94);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

/* ═══ Lightbox Layout ═══ */
.gp-lb-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    min-width: 0;
}

.gp-lb-img-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gpLbZoom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gpLbZoom {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.gp-lb-img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

/* ═══ Lightbox Side Panel ═══ */
.gp-lb-panel {
    width: 380px;
    flex-shrink: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: gpPanelSlide 0.5s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

@keyframes gpPanelSlide {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.gp-lb-panel-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gp-lb-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #a5b4fc;
}

.gp-lb-device-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #67e8f9;
    background: rgba(6,182,212,0.12);
    border: 1px solid rgba(6,182,212,0.2);
}

.gp-lb-panel-body {
    padding: 24px;
    flex: 1;
}

.gp-lb-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.4;
}

.gp-lb-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    line-height: 1.8;
    margin: 0 0 24px;
}

/* ═══ Info Cards inside panel ═══ */
.gp-lb-info-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.gp-lb-info-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.gp-lb-info-card-title i {
    color: var(--gp-accent);
    font-size: 13px;
}

.gp-lb-elements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gp-lb-element-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: #c7d2fe;
}
.gp-lb-element-tag i {
    font-size: 10px;
    color: #818cf8;
}

.gp-lb-benefit {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
}
.gp-lb-benefit i {
    color: #34d399;
    font-size: 11px;
    margin-top: 4px;
    flex-shrink: 0;
}

/* ═══ Lightbox Controls ═══ */
.gp-lb-close {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000001;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.gp-lb-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

.gp-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.gp-lb-nav:hover {
    background: rgba(99,102,241,0.5);
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-50%) scale(1.1);
}
.gp-lb-nav-prev { right: 20px; }
.gp-lb-nav-next { left: 20px; }

/* ═══ Lightbox Panel Toggle (mobile) ═══ */
.gp-lb-panel-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000001;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}
.gp-lb-panel-toggle:hover {
    background: rgba(99,102,241,0.3);
}

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1200px) {
    .gp-lb-panel { width: 340px; }
}

@media (max-width: 991px) {
    .gp-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .gp-device-tabs { justify-content: center; }
    .gp-search-wrap { flex: 1; min-width: 100%; }
    .gp-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .gp-grid[data-device="mobile"],
    .gp-grid[data-device="ipad"] {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    /* Lightbox Mobile */
    .gp-lightbox { flex-direction: column-reverse; }
    .gp-lb-panel {
        width: 100%;
        max-height: 45vh;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.06);
        display: none;
    }
    .gp-lb-panel.gp-panel-visible { display: flex; }
    .gp-lb-panel-toggle { display: flex; }
    .gp-lb-main { padding: 60px 16px 70px; }
    .gp-lb-nav { width: 40px; height: 40px; font-size: 14px; }
    .gp-lb-nav-prev { right: 10px; }
    .gp-lb-nav-next { left: 10px; }
    @keyframes gpPanelSlide {
        from { transform: translateY(30px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}

@media (max-width: 575px) {
    .gp-section { padding: 50px 0 70px; }
    .gp-device-tab {
        padding: 8px 12px;
        font-size: 12px;
        gap: 5px;
    }
    .gp-device-tab i { font-size: 16px; }
    .gp-device-tab .gp-tab-label { display: none; }
    .gp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .gp-grid[data-device="mobile"],
    .gp-grid[data-device="ipad"] {
        grid-template-columns: repeat(2, 1fr);
    }
    .gp-card-caption { padding: 10px 12px 12px; }
    .gp-card-caption h5 { font-size: 12px; }
    .gp-card-caption p { font-size: 11px; -webkit-line-clamp: 1; }
    .gp-lb-title { font-size: 18px; }
    .gp-lb-desc { font-size: 13px; }
}

/* ═══════════ Animations ═══════════ */
@keyframes gpCardEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gp-card {
    animation: gpCardEnter 0.5s ease both;
}

.gp-card:nth-child(1) { animation-delay: 0s; }
.gp-card:nth-child(2) { animation-delay: 0.03s; }
.gp-card:nth-child(3) { animation-delay: 0.06s; }
.gp-card:nth-child(4) { animation-delay: 0.09s; }
.gp-card:nth-child(5) { animation-delay: 0.12s; }
.gp-card:nth-child(6) { animation-delay: 0.15s; }
.gp-card:nth-child(7) { animation-delay: 0.18s; }
.gp-card:nth-child(8) { animation-delay: 0.21s; }
.gp-card:nth-child(9) { animation-delay: 0.24s; }
.gp-card:nth-child(10) { animation-delay: 0.27s; }
.gp-card:nth-child(11) { animation-delay: 0.30s; }
.gp-card:nth-child(12) { animation-delay: 0.33s; }
