/* ================================================
   PI(C)XEL VAULT - Custom Styles
   ================================================ */

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.5); }

/* ===== SMOOTH SCROLL ===== */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ===== SELECTION ===== */
::selection { background: rgba(108, 92, 231, 0.3); color: inherit; }
[data-theme="dark"] ::selection { background: rgba(167, 139, 250, 0.3); }

/* ===== GRADIENT ORB BLOBS ===== */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    transition: background-color 0.4s;
}

/* ===== NAVBAR SHADOW ===== */
.navbar-scrolled { box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1); }
[data-theme="dark"] .navbar-scrolled { box-shadow: 0 5px 30px rgba(0, 0, 0, 0.4); }

/* ===== ACTIVE NAV LINK ===== */
.nav-link.active { color: #6c5ce7; background: rgba(108, 92, 231, 0.1); }
[data-theme="dark"] .nav-link.active { color: #a78bfa; background: rgba(167, 139, 250, 0.15); }

/* ===== THEME TOGGLE SWITCH ===== */
.theme-switch::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .theme-switch::before {
    transform: translateX(24px);
    background: #0a0a14;
}

/* ===== HAMBURGER ===== */
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* ===== MOBILE NAV ===== */
@media (max-width: 1023px) {
    .nav-links {
        position: fixed;
        top: 70px; left: 0; right: 0;
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        transform: translateY(-150%);
        transition: transform 0.35s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }
    [data-theme="light"] .nav-links { background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
    [data-theme="dark"] .nav-links { background: rgba(10, 10, 20, 0.95); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .nav-links.active { display: flex !important; transform: translateY(0); }
    .nav-links li a { width: 100%; padding: 0.75rem 1rem; }
}

/* ===== FILTER TAGS ===== */
.filter-tag {
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}
[data-theme="light"] .filter-tag { background: #f0f2f5; color: #666; border: 1px solid rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .filter-tag { background: #1a1a2e; color: #888; border: 1px solid rgba(255, 255, 255, 0.06); }
.filter-tag:hover, .filter-tag.active { border-color: transparent; }
[data-theme="light"] .filter-tag:hover, [data-theme="light"] .filter-tag.active { background: #6c5ce7; color: #fff; }
[data-theme="dark"] .filter-tag:hover, [data-theme="dark"] .filter-tag.active { background: #a78bfa; color: #fff; }

/* ===== CARD OVERLAY ===== */
.card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 50%);
    opacity: 0; transition: opacity 0.35s ease;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.25rem;
}
.wallpaper-card:hover .card-overlay { opacity: 1; }

/* ===== CARD META ===== */
.card-meta {
    display: flex; align-items: center; gap: 0.8rem;
    color: rgba(255, 255, 255, 0.55); font-size: 0.75rem; margin-top: 0.3rem;
}
.card-meta span { display: flex; align-items: center; gap: 0.25rem; }

/* ===== CARD ACTIONS ===== */
.card-actions {
    position: absolute; top: 0.8rem; right: 0.8rem;
    display: flex; flex-direction: column; gap: 0.4rem;
    opacity: 0; transform: translateX(10px);
    transition: all 0.3s ease; z-index: 5;
}
.wallpaper-card:hover .card-actions { opacity: 1; transform: translateX(0); }

.action-btn {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; font-size: 0.85rem;
}
.action-btn:hover { transform: scale(1.1); }
[data-theme="light"] .action-btn:hover { background: #6c5ce7; }
[data-theme="dark"] .action-btn:hover { background: #a78bfa; }
.action-btn.liked { background: #ef4444 !important; border-color: #ef4444 !important; }

/* ===== DOWNLOAD BUTTON STATES ===== */
.download-btn.downloading {
    pointer-events: none;
    background: rgba(34, 197, 94, 0.7) !important;
    border-color: rgba(34, 197, 94, 0.7) !important;
}

.download-btn.downloading i {
    animation: downloadSpin 1s linear infinite;
}

@keyframes downloadSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-btn.downloaded {
    background: rgba(34, 197, 94, 0.8) !important;
    border-color: rgba(34, 197, 94, 0.8) !important;
}

/* ===== DOWNLOAD TOAST NOTIFICATION ===== */
.download-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.8rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .download-toast {
    background: #1a1a2e;
    color: #fff;
}

[data-theme="dark"] .download-toast {
    background: #fff;
    color: #1a1a2e;
}

.download-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.download-toast i {
    font-size: 1.1rem;
    color: #22c55e;
}

.download-toast.error i {
    color: #ef4444;
}

/* ===== BADGES ===== */
.res-badge {
    position: absolute; top: 0.8rem; left: 0.8rem;
    padding: 0.25rem 0.65rem;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 8px; color: #fff; font-size: 0.65rem; font-weight: 600;
    letter-spacing: 0.3px; z-index: 5;
}

.live-badge {
    position: absolute; top: 0.8rem; left: 0.8rem;
    padding: 0.25rem 0.7rem;
    background: rgba(239, 68, 68, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 8px; color: #fff; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.35rem; z-index: 5;
}

.live-dot {
    width: 6px; height: 6px; background: #fff; border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== SOCIAL LINKS ===== */
.social-link {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; font-size: 0.95rem;
}
[data-theme="light"] .social-link { background: #f0f2f5; color: #666; border: 1px solid rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .social-link { background: #1a1a2e; color: #888; border: 1px solid rgba(255, 255, 255, 0.06); }
.social-link:hover { transform: translateY(-3px); color: #fff !important; }
[data-theme="light"] .social-link:hover { background: #6c5ce7; border-color: #6c5ce7; }
[data-theme="dark"] .social-link:hover { background: #a78bfa; border-color: #a78bfa; }

/* ===== FOOTER LINKS ===== */
.footer-link { display: block; font-size: 0.9rem; padding: 0.35rem 0; transition: color 0.3s ease; }
[data-theme="light"] .footer-link { color: #777; }
[data-theme="dark"] .footer-link { color: #888; }
[data-theme="light"] .footer-link:hover { color: #6c5ce7; }
[data-theme="dark"] .footer-link:hover { color: #a78bfa; }

/* ===== IMAGE LOADING ===== */
.wallpaper-card img { background: linear-gradient(135deg, #1a1a2e, #2a2a45); }
[data-theme="light"] .wallpaper-card img { background: linear-gradient(135deg, #e8e8ee, #d5d5e0); }

/* ================================================
   CARD PAGES (phone.html, images.html)
   ================================================ */

/* Page Banner */
.page-banner { position: relative; height: 350px; overflow: hidden; }
.page-banner__bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.05); }
.page-banner__overlay { position: absolute; inset: 0; transition: background 0.4s; }
[data-theme="light"] .page-banner__overlay { background: linear-gradient(to bottom, rgba(240,242,245,0) 0%, rgba(240,242,245,1) 100%); }
[data-theme="dark"] .page-banner__overlay { background: linear-gradient(to bottom, rgba(10,10,20,0) 0%, rgba(10,10,20,1) 100%); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; flex-wrap: wrap; }
.breadcrumb a { transition: color 0.3s; }
[data-theme="light"] .breadcrumb a { color: #888; }
[data-theme="dark"] .breadcrumb a { color: #777; }
[data-theme="light"] .breadcrumb a:hover { color: #6c5ce7; }
[data-theme="dark"] .breadcrumb a:hover { color: #a78bfa; }
.breadcrumb .current { font-weight: 600; }
[data-theme="light"] .breadcrumb .current { color: #333; }
[data-theme="dark"] .breadcrumb .current { color: #e0e0e0; }
.breadcrumb .separator { font-size: 0.7rem; }
[data-theme="light"] .breadcrumb .separator { color: #ccc; }
[data-theme="dark"] .breadcrumb .separator { color: #444; }

/* Controls Bar */
.controls-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

.sort-select {
    appearance: none;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: 12px; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: all 0.3s; outline: none;
    background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
[data-theme="light"] .sort-select { background-color: #fff; border: 1px solid rgba(0,0,0,0.1); color: #555; }
[data-theme="dark"] .sort-select { background-color: #1a1a2e; border: 1px solid rgba(255,255,255,0.08); color: #aaa; }
.sort-select:focus { border-color: #6c5ce7; }
[data-theme="dark"] .sort-select:focus { border-color: #a78bfa; }

/* Results Count */
.results-count { font-size: 0.9rem; }
[data-theme="light"] .results-count { color: #888; }
[data-theme="dark"] .results-count { color: #777; }
.results-count strong { font-weight: 700; }
[data-theme="light"] .results-count strong { color: #333; }
[data-theme="dark"] .results-count strong { color: #e0e0e0; }

/* Load More */
.load-more-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.9rem 2.5rem; border-radius: 14px;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s; border: none;
}
[data-theme="light"] .load-more-btn { background: #6c5ce7; color: #fff; }
[data-theme="dark"] .load-more-btn { background: #a78bfa; color: #0a0a14; }
.load-more-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3); }
[data-theme="dark"] .load-more-btn:hover { box-shadow: 0 10px 30px rgba(167, 139, 250, 0.3); }

/* Back to Top */
.back-to-top {
    position: fixed; bottom: 2rem; right: 2rem;
    width: 48px; height: 48px; border-radius: 14px; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 999;
    opacity: 0; transform: translateY(20px);
    transition: all 0.3s; font-size: 1.1rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
[data-theme="light"] .back-to-top { background: #6c5ce7; color: #fff; }
[data-theme="dark"] .back-to-top { background: #a78bfa; color: #0a0a14; }
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }