/* MyPaper - Modern Stylesheet v2.8 (Complete) by Peelish Studios */

/* -------------------------------------------------------------------------- */
/* Variables & Global Styles */
/* -------------------------------------------------------------------------- */
:root {
    --bg-dark: #121212;
    --surface-1: #1e1e1e;
    --surface-2: #2a2a2a;
    --surface-3: #3f3f3f;
    --primary: #8a4fff;
    --primary-light: #a072ff;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #3a3a3a;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --heat: #ff9800; /* New heat color */
    
    --font-main: 'Inter', sans-serif;
    --shadow-sm: 0 4px 10px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.3);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s var(--easing);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); background-color: var(--bg-dark); color: var(--text-primary); line-height: 1.6; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }

/* Add this to your existing style.css file */
.hidden {
    display: none !important;
}
/* Add these new styles to your existing style.css file */

.hidden {
    display: none !important;
}

/* --- Skeleton Loader --- */
@keyframes skeleton-pulse {
    0% { background-color: var(--surface-2); }
    50% { background-color: var(--surface-3); }
    100% { background-color: var(--surface-2); }
}

.wallpaper-card-skeleton {
    background: var(--surface-1);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-container-skeleton {
    aspect-ratio: 16 / 10;
    animation: skeleton-pulse 2s infinite ease-in-out;
}

.info-skeleton {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.title-skeleton {
    width: 60%;
    height: 20px;
    border-radius: var(--border-radius-sm);
    animation: skeleton-pulse 2s infinite ease-in-out;
}

.uploader-skeleton {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    animation: skeleton-pulse 2s infinite ease-in-out;
}

#load-more-sentinel {
    height: 50px;
    width: 100%;
    grid-column: 1 / -1; /* Make sure it spans the full grid width */
}
/* -------------------------------------------------------------------------- */
/* General Layout & Components */
/* -------------------------------------------------------------------------- */
.site-header { background: rgba(18, 18, 18, 0.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--border-color); }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1400px; margin: 0 auto; padding: 15px 20px; }
.logo a { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.logo i { color: var(--primary); }
.main-nav ul { list-style: none; display: flex; gap: 0.5rem; align-items: center; }
.main-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 10px 16px; color: var(--text-secondary); font-weight: 500; border-radius: var(--border-radius-md); transition: var(--transition); }
.main-nav a:hover { color: var(--text-primary); background-color: var(--surface-2); }
.main-nav a.active { color: #fff; background-color: var(--primary); }
.main-nav a i { font-size: 1.1rem; }
.button, .btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 12px 24px; background: var(--primary); color: #fff; text-decoration: none; border-radius: var(--border-radius-md); border: none; cursor: pointer; font-size: 1rem; font-weight: 500; transition: var(--transition); }
.button:hover, .btn:hover, button:hover { background: var(--primary-light); transform: translateY(-2px); }
.button-secondary { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border-color); }
.button-secondary:hover { background: var(--surface-3); border-color: var(--primary); color: var(--text-primary); }
.button-danger { background: var(--danger); }
.button-success { background: var(--success); }
.button-small { padding: 8px 16px; font-size: 0.9rem; }

/* -------------------------------------------------------------------------- */
/* Home Page: Header, Search & Tags */
/* -------------------------------------------------------------------------- */
.page-header { text-align: center; padding: 3rem 0; animation: fadeIn 0.8s var(--easing); }
.page-header h1 { font-size: 3rem; font-weight: 700; margin-bottom: 1.5rem; background: linear-gradient(90deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.search-bar { position: relative; max-width: 600px; margin: 0 auto 2.5rem auto; }
.search-bar input { width: 100%; padding: 1rem 3.5rem 1rem 1.5rem; font-size: 1rem; border: 1px solid var(--border-color); border-radius: 50px; background: var(--surface-1); color: var(--text-primary); transition: var(--transition); }
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(138, 79, 255, 0.2); }
.search-bar i { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); transition: var(--transition); }
.search-bar input:focus + i { color: var(--primary); }
.tag-navigation { margin-bottom: 2.5rem; }
.tag-navigation ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }
.tag-navigation a { position: relative; display: block; padding: 0.5rem 1.25rem; background: var(--surface-2); color: var(--text-secondary); text-decoration: none; border-radius: 20px; transition: var(--transition); font-weight: 500; border: 1px solid transparent; overflow: hidden; }
.tag-navigation a:hover { background: var(--surface-3); color: var(--text-primary); transform: translateY(-2px); }
.tag-navigation a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-navigation a::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.6s var(--easing); }
.tag-navigation a:hover::after { left: 100%; }


/* -------------------------------------------------------------------------- */
/* Wallpaper Card Styling */
/* -------------------------------------------------------------------------- */
.wallpaper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.wallpaper-card { background: var(--surface-1); border-radius: var(--border-radius-lg); overflow: hidden; transition: var(--transition); border: 1px solid var(--border-color); text-decoration: none; position: relative; }
.wallpaper-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.wallpaper-card.on-fire { border-color: var(--heat); box-shadow: 0 0 25px rgba(255, 152, 0, 0.4), 0 0 10px rgba(255, 152, 0, 0.3); animation: onFire 2s infinite alternate; }
@keyframes onFire { from { box-shadow: 0 0 25px rgba(255, 152, 0, 0.4), 0 0 10px rgba(255, 152, 0, 0.3); } to { box-shadow: 0 0 35px rgba(255, 87, 34, 0.5), 0 0 15px rgba(255, 87, 34, 0.4); } }
.image-container { aspect-ratio: 16 / 10; overflow: hidden; position: relative; }
.private-overlay { position: absolute; top: 10px; right: 10px; background: rgba(18, 18, 18, 0.7); backdrop-filter: blur(5px); color: var(--text-secondary); padding: 5px 10px; border-radius: 8px; font-size: 0.8rem; display: flex; align-items: center; gap: 5px; }
.image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--easing); }
.wallpaper-card:hover img { transform: scale(1.05); }
.wallpaper-card .info { padding: 1rem 1.25rem; }
.wallpaper-card .title { font-size: 1.1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.75rem; }
.wallpaper-card .title a { color: var(--text-primary); text-decoration: none; }
.wallpaper-card .title a:hover { color: var(--primary); }
.card-actions { display: flex; justify-content: space-between; align-items: center; }
.heat-button { background: none; border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; padding: 5px; border-radius: 8px; transition: var(--transition); }
.heat-button:hover { color: var(--heat); }
.heat-button.liked, .heat-button.liked:hover { color: var(--heat); }
.heat-button .fa-fire { transition: transform 0.3s var(--easing); }
.heat-button.liked .fa-fire { animation: firePulse 0.5s var(--easing); }
@keyframes firePulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.wallpaper-card .uploader { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.9rem; flex-shrink: 0; }
.pfp-small { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.uploader-link { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.uploader-link:hover { color: var(--text-primary); }


/* -------------------------------------------------------------------------- */
/* Profile Page Styling */
/* -------------------------------------------------------------------------- */
.profile-page { animation: fadeIn 0.6s var(--easing); }
.profile-header-banner { padding: 2.5rem; background: var(--surface-1); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); margin-bottom: 2.5rem; }
.profile-header-content { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem; }
.profile-info { flex-grow: 1; }
.pfp-container { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 4px solid var(--primary); }
.profile-pfp { width: 100%; height: 100%; object-fit: cover; }
.profile-name-badge { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.profile-name-badge h1 { font-size: 2.2rem; }
.profile-pronouns { font-size: 1rem; color: var(--text-secondary); background: var(--surface-2); padding: 4px 10px; border-radius: 15px; }
.profile-bio { 
    color: var(--text-secondary); 
    margin-bottom: 1rem; 
    max-width: 60ch;
    overflow-wrap: break-word; /* Break long words */
    word-wrap: break-word; /* Legacy browser support */
    hyphens: auto; /* Add hyphens when breaking words */
}
.profile-stats-inline { display: flex; gap: 1.5rem; color: var(--text-secondary); }
.profile-stats-inline a, .profile-stats-inline span { color: var(--text-secondary); }
.profile-stats-inline a:hover { color: var(--primary); }
.profile-actions { margin-left: auto; }
.content-title { font-size: 1.8rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.badge { padding: 5px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.badge-admin { background: rgba(220, 53, 69, 0.2); color: #dc3545; }
.badge-moderator { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.badge-verified { background: rgba(40, 167, 69, 0.2); color: #28a745; }
.badge-professional { background: rgba(0, 123, 255, 0.2); color: #007bff; }
.badge-contributor { background: rgba(23, 162, 184, 0.2); color: #17a2b8; }
.badge-user { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.badge-flagged { background: var(--danger); color: #fff; }
.badge-secret { background: var(--surface-3); color: var(--text-secondary); }

/* -------------------------------------------------------------------------- */
/* Form & Auth Pages */
/* -------------------------------------------------------------------------- */
.form-container, .auth-form { max-width: 500px; margin: 40px auto; padding: 40px; background: var(--surface-1); border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); }
.form-container h2, .auth-form h2 { text-align: center; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--surface-2); color: var(--text-primary); font-size: 1rem; }
textarea { resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(138, 79, 255, 0.2); }
.auth-link { text-align: center; margin-top: 20px; color: var(--text-secondary); }
.char-counter { display: block; text-align: right; font-size: 0.8rem; color: var(--text-secondary); margin-top: 5px; }


/* -------------------------------------------------------------------------- */
/* Admin Panel */
/* -------------------------------------------------------------------------- */
.admin-panel h1 { margin-bottom: 2rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.admin-card { background: var(--surface-1); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.admin-card-header h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.admin-card-header h2 i { color: var(--primary); }
.item-count { background: var(--primary); color: #fff; font-weight: 600; font-size: 0.9rem; padding: 4px 10px; border-radius: 20px; }
.admin-card-content { padding: 0.5rem; max-height: 500px; overflow-y: auto; }
.no-items-message { color: var(--text-secondary); text-align: center; padding: 2rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table tr:not(:last-child) { border-bottom: 1px solid var(--border-color); }
.admin-table td { padding: 1rem; vertical-align: middle; }
.admin-table small { display: block; color: var(--text-secondary); font-size: 0.9rem; }
.table-preview { width: 80px; height: 50px; object-fit: cover; border-radius: var(--border-radius-sm); margin-right: 1rem; }
.report-reason { font-style: italic; color: var(--text-secondary); margin-top: 0.5rem; }
.reporter-info { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.user-info-cell { display: flex; align-items: center; gap: 1rem; }
.user-info-cell .pfp-small { width: 40px; height: 40px; }
.user-manage-form { display: flex; flex-direction: column; gap: 1rem; }
.badge-selector { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge-selector input[type="radio"] { display: none; }
.badge-selector .badge-option { padding: 5px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; cursor: pointer; opacity: 0.6; transition: var(--transition); }
.badge-selector input[type="radio"]:checked + .badge-option { opacity: 1; transform: scale(1.05); box-shadow: 0 0 0 2px var(--primary); }
.toggles { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.flag-toggle label { cursor: pointer; }
.actions-cell { text-align: right; }
.actions-cell .button { margin-left: 0.5rem; }


/* -------------------------------------------------------------------------- */
/* Wallpaper Detail Page */
/* -------------------------------------------------------------------------- */
.wallpaper-detail-page { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; align-items: start; }
.wallpaper-image-container img { border-radius: var(--border-radius-lg); }
.wallpaper-info-container h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.uploader-info { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.uploader-info img { width: 50px; height: 50px; border-radius: 50%; }
.wallpaper-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.5rem; color: var(--text-secondary); }
.download-button { width: 100%; margin-bottom: 1rem; }
.wallpaper-management { padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.wallpaper-management.owner-management { margin-top: 1.5rem; }
.wallpaper-management h3 { margin-bottom: 1rem; }
.management-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.management-actions .button { flex-grow: 1; }
.tags-container { margin-top: 2rem; }
.tags-container h3 { margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { background: var(--surface-2); padding: 5px 12px; border-radius: 15px; color: var(--text-secondary); font-size: 0.9rem; }
.tag:hover { background: var(--surface-3); color: var(--text-primary); }
#share-feedback { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--success); color: #fff; padding: 12px 25px; border-radius: 50px; z-index: 2000; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
#share-feedback.visible { opacity: 1; transform: translateX(-50%) translateY(-20px); }

/* --- Upload Page: Tag Selection --- */
.tag-selection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.tag-checkbox input[type="checkbox"] { display: none; }
.tag-checkbox label { display: block; text-align: center; padding: 10px; background: var(--surface-2); color: var(--text-secondary); border-radius: var(--border-radius-md); cursor: pointer; transition: var(--transition); border: 1px solid var(--border-color); }
.tag-checkbox label:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--primary); }
.tag-checkbox input[type="checkbox"]:checked + label { background: var(--primary); color: #fff; border-color: var(--primary-light); font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* Utility & Other Pages */
/* -------------------------------------------------------------------------- */
.no-results-box { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; background: var(--surface-1); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); color: var(--text-secondary); }
.no-results-box i { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.no-results-box h3 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 0.5rem; }


/* -------------------------------------------------------------------------- */
/* Animations */
/* -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------- */
/* Responsive Design */
/* -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .wallpaper-detail-page { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-container { flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0; }
    .profile-header-content { flex-direction: column; text-align: center; }
    .profile-actions { margin-left: 0; }
    .profile-name-badge { justify-content: center; }
    .management-actions .button { flex-basis: 100%; }
}

/* --- Mobile Nav Styles --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    .main-nav {
        position: fixed;
        inset: 0 0 0 30%;
        background: var(--surface-1);
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav ul {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        height: 100%;
        padding: 2rem;
    }
    .main-nav ul[data-visible="true"] {
        transform: translateX(0);
    }
    .main-nav a.button {
        display: block;
        width: 100%;
        text-align: center;
    }
    .mobile-nav-toggle {
        display: block;
    }
}

/* --- Audio Card Styles --- */
.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.audio-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    padding-bottom: 1.5rem;
}
.audio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.audio-card-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}
.play-icon {
    font-size: 3rem;
    color: var(--primary);
}
.audio-info {
    flex-grow: 1;
}
.audio-info .title {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}
.audio-info .stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.owner-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
}
.owner-controls .button {
    flex-grow: 1;
}

/* --- Upload Page Selector Styles --- */
.file-type-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.file-type-selector .button.active {
    background: var(--primary);
}
.file-type-selector .button.active:hover {
    background: var(--primary-light);
}
.file-type-selector .button {
    flex-grow: 1;
}

/* --- Beta Tag --- */
.beta-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--warning);
    color: black;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
    letter-spacing: 0.5px;
}