/* LOADING SCREEN, THEME TOGGLE, FOOTER & ENHANCED EFFECTS */

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-8);
    animation: slideDown 0.6s ease;
}

.loading-logo i {
    font-size: var(--text-4xl);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto var(--space-4);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-muted);
    font-size: var(--text-base);
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    left: 0;
    top: 0;
}

.theme-toggle:hover::before {
    width: 100%;
}

.theme-toggle i {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    border-color: transparent;
}

.theme-toggle:hover i {
    color: white;
}

/* ==================== TOP DOWNLOADS ==================== */
.top-downloads {
    margin-bottom: var(--space-12);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-8);
}

.section-title i {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fire-flicker 2s ease-in-out infinite;
}

@keyframes fire-flicker {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.top-downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border-strong);
    margin-top: var(--space-20);
    padding: var(--space-16) 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer-logo i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.footer-stats {
    display: flex;
    gap: var(--space-6);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
    /* Wider for large numbers */
}

.stat-item i {
    font-size: var(--text-xl);
    color: var(--accent-primary);
}

.stat-item span {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    /* Prevent wrapping */
    min-width: 80px;
    /* Space for 7 digits + commas */
    text-align: center;
}

.stat-item small {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* FreeVisitorCounters Widget Styling */
.visitor-counter {
    min-width: 140px;
}

.counter-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
}

.counter-widget a {
    display: none !important;
    /* Hide attribution link */
}

.counter-widget img {
    max-height: 28px;
    border-radius: 4px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
    background: var(--surface);
    transform: translateX(5px);
}

.footer-links a i {
    width: 20px;
}

.social-links {
    display: flex;
    gap: var(--space-3);
}

.social-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-lg);
    transition: all var(--transition-base);
}

.social-links a:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-5px) rotate(360deg);
    box-shadow: var(--shadow-md);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border-strong);
    padding: var(--space-6) 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.footer-love {
    margin-top: var(--space-2);
}

.footer-love i {
    color: #E53E3E;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1);
    }
}

/* ==================== ENHANCED BUTTON EFFECTS ==================== */
.btn-card,
.btn-download-viewer,
.btn-share {
    position: relative;
    overflow: hidden;
}

.btn-card::before,
.btn-download-viewer::before,
.btn-share::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-card:active::before,
.btn-download-viewer:active::before,
.btn-share:active::before {
    width: 300px;
    height: 300px;
}

/* Badge Download Counter */
.download-count {
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.wallpaper-card:hover .download-count {
    opacity: 1;
    transform: translateY(0);
}

.download-count i {
    font-size: 10px;
}