/* ===== VARS ===== */
:root {
    --wp-accent: var(--primary);
    --wp-accent-dim: rgba(230, 126, 219, 0.12);
}

/* ===== CONTAINER ===== */
.wp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 80px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-sizing: border-box;
    width: 100%;
}

/* ===== TOOLBAR ===== */
.wp-toolbar {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.wp-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

.wp-search-wrap .iconify {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 17px;
    pointer-events: none;
}

.wp-search-wrap input {
    background: #1a1a1a;
    border: none;
    color: #fff;
    padding: 12px 16px 12px 42px;
    border-radius: 14px;
    font-size: 13.5px;
    font-family: 'Comfortaa', cursive;
    width: 100%;
    transition: background 0.2s;
    box-sizing: border-box;
    outline: none;
}

.wp-search-wrap input:focus {
    background: #222222;
}

/* ===== CUSTOM DROPDOWN ===== */
.wp-dropdown {
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.wp-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: #1a1a1a;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Comfortaa', cursive;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    min-width: 180px;
    justify-content: space-between;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#wp-sort-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.wp-dropdown-btn:hover {
    background: #242424;
    color: #fff;
}

.wp-dropdown-btn.open {
    background: #242424;
    color: var(--primary);
}

.wp-dropdown-arrow {
    font-size: 16px;
    color: #777;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.wp-dropdown-btn.open .wp-dropdown-arrow {
    transform: rotate(180deg);
}

.wp-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 100%;
    background: #1e1e22;
    border: none;
    border-radius: 14px;
    z-index: 1000;
    overflow: hidden;
    display: none;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.wp-dropdown-menu.open {
    display: block;
}

.wp-dropdown-option {
    padding: 12px 18px;
    font-size: 13px;
    font-family: 'Comfortaa', cursive;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: none;
    box-sizing: border-box;
    width: 100%;
}

.wp-dropdown-option:last-child { border-bottom: none; }

.wp-dropdown-option:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.95);
}

.wp-dropdown-option.selected {
    color: var(--primary);
    font-weight: 700;
}

/* ===== GRID ===== */
.wp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

/* ===== CARD ===== */
.wp-card {
    border-radius: 16px;
    overflow: hidden;
    background: #1a1a1a;
    border: none;
    transition: background 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.wp-card:hover {
    background: #242424;
}

.wp-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: #111;
}

.wp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wp-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
    z-index: 1;
}

.wp-card-engine-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Comfortaa', cursive;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.6);
    border: none;
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
}

.wp-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
}

.wp-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #e0e0ee;
    letter-spacing: 0.02em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wp-card-meta {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.wp-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
}

.wp-card-stat .iconify { font-size: 13px; }

.wp-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.wp-card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Comfortaa', cursive;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    letter-spacing: 0.03em;
}

.wp-card-link:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

/* ===== EMPTY ===== */
.wp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.25);
    font-size: 18px;
    font-weight: 600;
}

/* ===== PAGINATION ===== */
.wp-pagination {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.wp-page-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1a1a1a;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Comfortaa', cursive;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-page-btn:hover {
    background: #252525;
    color: #fff;
}

.wp-page-btn.active {
    background: var(--primary);
    color: #fff;
}

/* ===== SKELETON ===== */
.wp-skeleton {
    background: linear-gradient(90deg, #1c1c22 25%, #232330 50%, #1c1c22 75%);
    background-size: 200% 100%;
    animation: wp-skel 1.6s infinite;
    border-radius: 14px;
}

@keyframes wp-skel {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== BOTTOM STAT CARDS (Statistic.html style) ===== */
.wp-stat-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
}

.wp-stat-grid .stat-card {
    height: 220px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease, filter 0.4s ease;
    border: 0;
    cursor: pointer;
}

.wp-stat-grid .stat-card:hover {
    transform: translateY(-5px);
    filter: brightness(1.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.wp-stat-grid .card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.wp-stat-grid .card-title {
    position: absolute;
    text-transform: uppercase;
    line-height: 1;
    z-index: 2;
    font-family: 'Special Gothic Expanded One', sans-serif;
    top: 24px;
    left: 24px;
    font-size: 26px;
    font-weight: 400;
}

.wp-stat-grid .card-val {
    position: absolute;
    line-height: 1.1;
    z-index: 2;
    font-family: 'Special Gothic Expanded One', sans-serif;
    bottom: 20px;
    left: 24px;
    font-size: clamp(52px, 5.5vw, 84px);
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* 1. Wallpapers: Signature PiloHub Primary Pink/Magenta */
.card-wp-wallpapers {
    background: linear-gradient(135deg, #7e7ee6 0%, #3a4799 100%);
}

.card-wp-wallpapers .card-bg {
    background-image: url('https://r2.piloxarp.ru/Pilohub/assets/bg_main_card_4.png');
    background-position: right 72%;
    background-size: 50%;
    opacity: 0.35;
}

.card-wp-wallpapers .card-title,
.card-wp-wallpapers .card-val {
    background-image:linear-gradient(135deg, #b6bbff 0%, #d4d9ff 100%), radial-gradient(circle, #aab7ff4a 60%, rgb(121 151 243 / 40%) 120%);
    background-blend-mode: multiply;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 0px 36.8px rgba(0, 0, 0, 0.25));
}

/* 2. Subscribers: Cyan / Teal theme (matches card-videos in Statistic.html) */
.card-wp-subs {
    background: linear-gradient(-17deg, #63f85e 0%, #6fd9dd 100%);
}

.card-wp-subs .card-bg {
    background-image: url('https://r2.piloxarp.ru/Pilohub/assets/bg_main_card_5.png');
    background-position: right;
    background-size: 48%;
    opacity: 0.45;
}

.card-wp-subs .card-title,
.card-wp-subs .card-val {
    background-image:linear-gradient(-17deg, #75f85e 0%, #6fddd3 100%), radial-gradient(circle, #00000080 60%, rgb(0 0 0 / 44%) 120%);
    background-blend-mode: multiply;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 0px 36.8px rgba(0, 0, 0, 0.25));
}

/* 3. Views: Blue / Violet theme (matches card-arts in Statistic.html) */
.card-wp-views {
    background: linear-gradient(163deg, #ff839d 0%, #00000087 100%);
}

.card-wp-views .card-bg {
    background-image: url('https://r2.piloxarp.ru/Pilohub/assets/bg_main_card_7.png');
    background-position: right;
    background-size: 48%;
    opacity: 0.45;
}

.card-wp-views .card-title,
.card-wp-views .card-val {
    background-image:linear-gradient(163deg, #ff93b1 0%, #ff7c7c 100%), radial-gradient(circle, #00000057 60%, rgb(0 0 0 / 44%) 120%);
    background-blend-mode: multiply;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 0px 36.8px rgba(0, 0, 0, 0.25));
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .wp-stat-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .wp-stat-grid .stat-card {
        height: 180px;
    }
    .wp-stat-grid .card-title {
        font-size: 22px;
        top: 18px;
        left: 18px;
    }
    .wp-stat-grid .card-val {
        font-size: 54px;
        bottom: 16px;
        left: 18px;
    }
}

@media (max-width: 860px) {
    .wp-toolbar { flex-direction: column; align-items: stretch; gap: 10px; width: 100%; box-sizing: border-box; }
    .wp-search-wrap { width: 100%; min-width: 0; box-sizing: border-box; }
    .wp-search-wrap input { width: 100%; box-sizing: border-box; padding: 12px 14px 12px 42px; font-size: 13px; }
    .wp-dropdown { width: 100%; box-sizing: border-box; }
    .wp-dropdown-btn { width: 100%; min-width: 0; box-sizing: border-box; padding: 12px 16px; font-size: 13px; }
    .wp-dropdown-menu { left: 0; right: 0; width: 100%; min-width: 0; box-sizing: border-box; z-index: 1000; }
    .wp-dropdown-option { width: 100%; box-sizing: border-box; padding: 12px 16px; font-size: 13px; }
}

@media (max-width: 768px) {
    .wp-container { padding: 10px 0 80px 0; gap: 14px; width: 100%; box-sizing: border-box; }
    .wp-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .wp-stat-grid { gap: 12px; }
    .wp-stat-grid .stat-card { height: 160px; border-radius: 14px; }
    .wp-stat-grid .card-title { font-size: 20px; top: 16px; left: 16px; }
    .wp-stat-grid .card-val { font-size: clamp(34px, 9vw, 46px); bottom: 14px; left: 16px; }
}

@media (max-width: 420px) {
    .wp-grid { grid-template-columns: 1fr; }
}
