/* ============================================================
   XRD Studio Portfolio — Frontend CSS
   Developer: Huzaifa Saddique | huzaifatech.com | xRD Studio
   ============================================================ */

.xrd-portfolio-wrap *,
.xrd-portfolio-wrap *::before,
.xrd-portfolio-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.xrd-portfolio-wrap {
    font-family: var(--xrd-font-body, 'Inter', sans-serif);
    background: var(--xrd-bg, #181919);
    padding: 20px 16px 48px;
}

/* ══════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════ */
.xrd-filter-bar {
    background: var(--xrd-dark, #17152F);
    border-radius: 16px;
    padding: 20px 24px 22px;
    margin-bottom: 24px;
}

/* Row 1 — Search + Clear button */
.xrd-filter-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

/* Search input */
.xrd-search-wrap { position: relative; flex: 1; }

.xrd-search {
    width: 100%;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 10px !important;
    padding: 12px 44px 12px 16px;
    color: #fff;
    font-family: var(--xrd-font-body);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.xrd-search::placeholder { color: rgba(255,255,255,.3); }
.xrd-search:focus         { border-color: var(--xrd-accent, #1C78EE); }

.xrd-search-icon {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    display: flex; align-items: center; pointer-events: none;
}
.xrd-search-icon img { width:18px; height:18px; filter: brightness(0) invert(1); opacity:.5; }
.xrd-search-icon svg { stroke: rgba(255,255,255,.4); }

/* Clear Filters */
.xrd-clear-btn {
    background: #1C78EE !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-family: var(--xrd-font-body) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background .2s, transform .15s, box-shadow .2s !important;
    box-shadow: 0 4px 18px rgba(28,120,238,0.45) !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}
.xrd-clear-btn:hover {
    background: #1565cc !important;
    box-shadow: 0 6px 22px rgba(28,120,238,0.55) !important;
    transform: translateY(-1px) !important;
}
.xrd-clear-btn:active { transform: translateY(0) !important; }

/* Row 2 — Category (left) | Format (right) */
.xrd-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

/* Each group: label on top, pills below */
.xrd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.xrd-filter-label {
    color: rgba(255,255,255,0.55) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: var(--xrd-font-body) !important;
    line-height: 1.5 !important;
}

/* Pills */
.xrd-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.xrd-pill {
    background: rgba(255,255,255,0.06) !important;
    border: 1.5px solid rgba(255,255,255,0.18) !important;
    border-radius: 10px !important;
    color: rgba(255,255,255,0.80) !important;
    font-family: var(--xrd-font-body) !important;
    font-size: 14.4px !important;
    font-weight: 400 !important;
    padding: 7px 18px !important;
    cursor: pointer !important;
    transition: all .2s !important;
    outline: none !important;
    line-height: 26.8px !important;
    letter-spacing: 0.31px !important;
}
.xrd-pill:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,0.30) !important;
}
.xrd-pill.active {
    background: #1C78EE !important;
    border-color: #1C78EE !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(28,120,238,.35) !important;
}

/* ══════════════════════════════════════════
   BENTO GRID — JS builds .xrd-row wrappers
   Row 0,2,4 → equal   1fr 1fr
   Row 1,3,5 → bento   wide | narrow
══════════════════════════════════════════ */
.xrd-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.xrd-row {
    display: grid;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

/* Equal row: both cards same width */
.xrd-row--equal {
    grid-template-columns: 1fr 1fr;
}

/* Bento row: left card wider, right card narrower */
.xrd-row--bento {
    grid-template-columns: 3fr 2fr;
}

/* Card fixed height per row */
.xrd-row .xrd-card {
    min-height: var(--xrd-card-eq-height, 500px);
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.xrd-card {
    background: var(--xrd-card-bg, #fff);
    border-radius: 16px;
    overflow: hidden;
    padding: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
    display: flex;
    flex-direction: column;
    opacity: 0;
}

/* Entrance animation class added by JS */
.xrd-card.xrd-anim {
    animation: xrdFadeUp .5s ease forwards;
}

@keyframes xrdFadeUp {
    from { opacity:0; transform:translateY(22px); }
    to   { opacity:1; transform:translateY(0); }
}

.xrd-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 52px rgba(0,0,0,.14);
}

.xrd-card-link {
    display: flex; flex-direction: column; flex: 1;
    text-decoration: none; color: inherit;
    min-height: 0;
}

/* Image */
.xrd-card-image-wrap {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: var(--xrd-card-img-height, 200px);
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
    margin-bottom: 14px;
}

.xrd-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--xrd-img-fit, cover) !important;
    object-position: var(--xrd-img-position, center center) !important;
    display: block !important;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.xrd-card:hover .xrd-card-img { transform: scale(1.06); }

.xrd-card-img-placeholder {
    width:100%; height:100%; display:flex;
    align-items:center; justify-content:center; background:#f5f5f5;
}

/* Overlay */
.xrd-card-overlay {
    position:absolute; inset:0;
    background: rgba(17,21,47,.65);
    display:flex; align-items:center; justify-content:center;
    opacity:0; transition: opacity .3s; backdrop-filter:blur(2px);
    border-radius:12px;
}
.xrd-card:hover .xrd-card-overlay { opacity:1; }

.xrd-view-btn {
    background: var(--xrd-accent, #1C78EE);
    color:#fff; padding:10px 22px; border-radius:30px;
    font-family: var(--xrd-font-body); font-size:14px; font-weight:600;
    transform:translateY(8px);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    box-shadow:0 4px 16px rgba(28,120,238,.4);
    display:flex; align-items:center; gap:6px;
}
.xrd-view-btn img { width:16px; height:16px; filter:brightness(0) invert(1); }
.xrd-card:hover .xrd-view-btn { transform:translateY(0); }

/* Card body */
.xrd-card-body { padding:0 2px 4px; flex-shrink:0; }

.xrd-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }

.xrd-tag {
    background: var(--xrd-tag-bg, #f3f4f6);
    color: var(--xrd-tag-text, #374151);
    border:1px solid rgba(0,0,0,.08);
    border-radius:20px;
    font-family: var(--xrd-font-body);
    font-size:11px; font-weight:500;
    padding:4px 11px;
    letter-spacing:.3px; text-transform:uppercase;
    transition: background .2s, color .2s;
}
.xrd-card:hover .xrd-tag {
    background: rgba(28,120,238,.07);
    color: var(--xrd-accent, #1C78EE);
    border-color: rgba(28,120,238,.18);
}

.xrd-card-title {
    font-family: var(--xrd-font-head);
    font-size:18px; font-weight:700;
    color: var(--xrd-text, #021524);
    line-height:1.3; margin-bottom:4px;
    transition: color .22s;
}
.xrd-card:hover .xrd-card-title { color: var(--xrd-hover-title, #1C78EE); }

.xrd-card-subtitle {
    font-family: var(--xrd-font-body);
    font-size:14px; color: var(--xrd-text-sub, #6b7280); line-height:1.5;
}

/* ══════════════════════════════════════════
   NO RESULTS
══════════════════════════════════════════ */
.xrd-no-results,
.xrd-no-results-msg {
    text-align:center; color:rgba(255,255,255,.4);
    font-family: var(--xrd-font-body); font-size:15px;
    padding:48px 20px;
}

/* ══════════════════════════════════════════
   CTA BUTTON
══════════════════════════════════════════ */
.xrd-cta-wrap { display:flex; justify-content:center; margin-top:36px; }

.xrd-cta-btn {
    display:inline-flex; align-items:center; gap:8px;
    background: var(--xrd-dark, #17152F); color:#fff;
    text-decoration:none;
    font-family: var(--xrd-font-body); font-size:15px; font-weight:600;
    padding:14px 32px; border-radius:50px;
    transition: background .25s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.xrd-cta-btn img { width:18px; height:18px; filter:brightness(0) invert(1); transition:transform .2s; }
.xrd-cta-btn:hover {
    background: var(--xrd-accent, #1C78EE);
    transform:translateY(-2px);
    box-shadow:0 8px 28px rgba(28,120,238,.4); color:#fff;
}
.xrd-cta-btn:hover img { transform:translate(2px,-2px); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .xrd-row--equal,
    .xrd-row--bento { grid-template-columns: 1fr !important; }
    .xrd-row .xrd-card { min-height: auto !important; height: auto !important; }

    .xrd-filter-bar { padding: 16px !important; }

    .xrd-filter-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
    }
    .xrd-search-wrap { width: 100% !important; }
    .xrd-search { width: 100% !important; }
    .xrd-clear-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 13px 20px !important;
    }

    .xrd-filter-row {
        flex-direction: column !important;
        gap: 14px !important;
    }
    .xrd-filter-group { width: 100% !important; }
    .xrd-pills { gap: 6px !important; }
}

@media (min-width: 1024px) {
    .xrd-portfolio-wrap { padding: 32px 24px 60px; }
    .xrd-grid, .xrd-row { gap: 24px; }
    .xrd-filter-bar { padding: 22px 28px 24px; }
}

/* Spinner */
.xrd-spinner {
    width:36px; height:36px;
    border:3px solid rgba(255,255,255,.1);
    border-top-color: var(--xrd-accent,#1C78EE);
    border-radius:50%;
    animation: xrdSpin .7s linear infinite;
}
@keyframes xrdSpin { to { transform:rotate(360deg); } }

/* ══════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════ */
.xrd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}

.xrd-portfolio-wrap .xrd-pagination .xrd-page-btn,
.xrd-portfolio-wrap .xrd-pagination button.xrd-page-btn {
    min-width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    border: 1.5px solid rgba(28,120,238,0.35) !important;
    background: #ffffff !important;
    color: #1C78EE !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    font-family: var(--xrd-font-body, sans-serif) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.xrd-portfolio-wrap .xrd-pagination .xrd-page-btn:hover {
    background: #1C78EE !important;
    color: #ffffff !important;
    border-color: #1C78EE !important;
    box-shadow: 0 2px 8px rgba(28,120,238,0.25) !important;
    transform: none !important;
}

.xrd-portfolio-wrap .xrd-pagination .xrd-page-btn.active {
    background: #1C78EE !important;
    color: #ffffff !important;
    border-color: #1C78EE !important;
    box-shadow: 0 2px 10px rgba(28,120,238,0.35) !important;
}

.xrd-portfolio-wrap .xrd-pagination .xrd-page-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background: #f5f5f5 !important;
    color: #aaa !important;
    border-color: #e0e0e0 !important;
    box-shadow: none !important;
}

.xrd-portfolio-wrap .xrd-pagination .xrd-prev-next {
    padding: 0 18px !important;
    font-size: 13px !important;
}

/* Load More */
.xrd-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
}

.xrd-portfolio-wrap .xrd-loadmore-btn {
    padding: 12px 36px !important;
    border-radius: 50px !important;
    border: 1.5px solid var(--xrd-accent, #1C78EE) !important;
    background: transparent !important;
    color: var(--xrd-accent, #1C78EE) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: var(--xrd-font-body, sans-serif) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.xrd-portfolio-wrap .xrd-loadmore-btn:hover {
    background: var(--xrd-accent, #1C78EE) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(28,120,238,0.35) !important;
}

.xrd-portfolio-wrap .xrd-loadmore-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}
