/*
Theme Name: MacFiles Pro
Theme URI: https://example.com
Description: Dark macOS Apps Download Theme
Version: 2.8
Author: Your Name
*/

:root {
    --bg-body: #111113;
    --bg-sidebar: #161618;
    --bg-card: #1c1c1e;
    --bg-box: #1a1a1d;
    --border: #2a2a2e;
    --border-light: #3a3a3e;
    --text-main: #f9fbff;
    --text-dim: #9ca3af;
    --text-muted: #6b7280;
    --blue: #3b82f6;
    --green: #22c55e;
    --red: #ef4444;
    --sidebar-width: 320px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --shadow: 0 10px 35px rgba(0,0,0,0.35);
}

/* === BASE === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
img { max-width: 100%; display: block; }

/* === HEADER === */
.site-header {
    background: rgba(22, 22, 24, 0.95);
    border-bottom: 1px solid var(--border);
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    width: 100%;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    margin-right: 10px;
}

.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}

.logo-text { font-size: 19px; letter-spacing: -0.5px; }

.header-nav { flex: 1; }

.header-menu-list {
    display: flex;
    list-style: none;
    gap: 6px;
    margin: 0; padding: 0;
}

.header-menu-list li a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.header-menu-list li a:hover,
.header-menu-list li.current-menu-item a {
    color: white;
    background: rgba(255,255,255,0.08);
}

.header-search { width: 280px; }

.header-search form {
    position: relative;
    width: 100%;
}

.header-search input {
    width: 100%;
    background: #1c1c1e;
    border: 1px solid var(--border);
    color: white;
    padding: 10px 10px 10px 38px;
    border-radius: 99px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.header-search input:focus {
    background: var(--bg-card);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* === LAYOUT === */
.site-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: row-reverse;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-body);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

/* === SIDEBAR === */
.cm-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    padding: 28px 22px;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    box-shadow: inset 1px 0 0 var(--border);
    z-index: 90;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.cm-sidebar::-webkit-scrollbar { width: 6px; }
.cm-sidebar::-webkit-scrollbar-track { background: transparent; }
.cm-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
.cm-sidebar::-webkit-scrollbar-thumb:hover { background: #555; }

.cm-sidebar .brand-name { display: none; }

.cm-main {
    flex: 1;
    padding: 32px 42px 48px;
    max-width: calc(100% - var(--sidebar-width));
}

.page-gap { height: 20px; }

/* === SIDEBAR WIDGETS === */
.cm-sidebar .widget { margin-bottom: 35px; }

.cm-sidebar .widget-title,
.cm-sidebar h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 700;
    display: block;
}

.cm-sidebar ul { list-style: none; padding: 0; margin: 0; }
.cm-sidebar ul li { margin-bottom: 4px; }

.cm-sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cm-sidebar ul li a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    transform: translateX(4px);
}

.widget_categories ul,
.widget_pages ul,
.widget_nav_menu ul { list-style: none !important; }

.sidebar-app-widget {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.dl-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
}

.btn-dl-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14.5px;
    color: #fff;
    box-shadow: var(--shadow);
    transition: opacity .2s, transform .15s;
    font-family: inherit;
    box-sizing: border-box;
}
.btn-dl-sidebar:hover { opacity: .88; transform: translateY(-1px); }

.btn-dl-disabled {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.05);
    color: #444;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,.07);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
}

.dl-safe-badge {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    color: #555;
}

.info-box-sidebar {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 13px;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-row:last-child { border-bottom: none; }
.info-label { display: flex; align-items: center; gap: 6px; color: #555; font-size: 12.5px; }
.info-value { color: #e8e8e8; font-weight: 600; font-size: 12.5px; text-align: right; }

.nav-menu ul { list-style: none; padding: 0; margin: 20px 0 0; }
.nav-menu ul li { margin-bottom: 6px; }

.nav-menu ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 600;
}

.nav-menu ul li a:hover,
.nav-menu ul li.current-menu-item a {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-label {
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    color: var(--text-muted);
}

.cm-header { display: none; }

/* === HOME SECTION BOX === */
.home-section-box {
    background: #1a1a1d;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: none;
    padding-bottom: 0;
}

.section-title-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-see-all {
    font-size: 12px;
    font-weight: 600;
    color: #0a84ff;
    background: rgba(10,132,255,.1);
    border: 1px solid rgba(10,132,255,.2);
    padding: 5px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.btn-see-all:hover { background: rgba(10,132,255,.2); color: #3fa8ff; }

/* ── GRID — 4 columns fixed ── */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 0;
}

/* ── CARD — horizontal, index.php style ── */
.modern-card {
    background-color: #1c1c1e;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 16px 18px;
    text-decoration: none;
    transition: background .2s, border-color .2s, transform .2s;
    min-width: 0;
    height: auto;
    position: relative;
    box-shadow: none;
}

.modern-card:hover {
    background-color: #2c2c2e;
    border-color: rgba(255,255,255,.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* ── CARD ICON ── */
.card-icon-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    margin-bottom: 0;
}

.card-icon-wrap img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    background: none;
}

.placeholder-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    box-shadow: none;
}

/* ── CARD INFO ── */
.card-info {
    flex: 1;
    min-width: 0;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #e8e8e8;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: auto;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.modern-card:hover .card-title { color: #fff; }

.card-ver {
    font-size: 11.5px;
    color: #666;
    font-weight: 500;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.no-posts-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 14px;
}

/* === SINGLE POST === */
.single-app-container { width: 100%; }

.app-hero-card {
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 26px;
    display: flex;
    align-items: center;
    gap: 26px;
    margin-bottom: 26px;
    box-shadow: var(--shadow);
}

.hero-icon img {
    width: 120px; height: 120px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.hero-icon-placeholder {
    width: 120px; height: 120px;
    border-radius: 28px;
    background: linear-gradient(135deg, #2b2b32, #1c1c22);
}

.hero-info { flex: 1; }

.hero-cats { margin-bottom: 8px; }
.hero-cats a {
    display: inline-block;
    background: rgba(59,130,246,0.14);
    color: #93c5fd;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hero-title { font-size: 28px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.4px; }

.hero-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
    color: var(--text-dim); font-size: 13px;
}

.hero-meta-item { display: inline-flex; align-items: center; gap: 6px; }

.badge-new {
    background: var(--green); color: #0b1c10;
    font-size: 10px; font-weight: 800;
    padding: 4px 8px; border-radius: 8px; text-transform: uppercase;
}

.hero-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    min-width: 170px;
    transition: all 0.2s;
}

.btn-hero svg { width: 18px; height: 18px; }

.btn-blue {
    background: var(--btn-bg, var(--blue));
    color: #fff;
    box-shadow: 0 10px 25px rgba(59,130,246,0.35);
}
.btn-blue:hover { transform: translateY(-2px); }

.btn-green {
    background: rgba(34,197,94,0.12);
    color: var(--green);
    border: 1px solid rgba(34,197,94,0.6);
}
.btn-green:hover { background: var(--green); color: #0b1c10; }

.btn-disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

.screenshots-section,
.content-section,
.comments-section {
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 26px;
    margin-bottom: 26px;
    box-shadow: var(--shadow);
}

.section-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }

/* === SCREENSHOTS === */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.screenshot-item {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #111113;
    position: relative;
    aspect-ratio: 16/10;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.screenshot-item:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.screenshot-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    opacity: 0.9;
}

.screenshot-item:hover img { transform: scale(1.05); opacity: 1; }

/* === TABS === */
.content-tabs {
    display: flex; gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.tab-link {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}
.tab-link.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.entry-content { color: var(--text-dim); font-size: 15px; line-height: 1.8; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: #fff; margin: 20px 0 12px; }
.entry-content a { color: #93c5fd; }

.requirements-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}
.requirements-box h4 { margin: 0 0 12px; }
.requirements-box ul { list-style: none; padding: 0; }
.requirements-box li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-dim); }
.requirements-box li:last-child { border-bottom: none; }
.requirements-box strong { color: #fff; }

.comments-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

.fade-in-card { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 1400px) {
    .modern-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (max-width: 1100px) {
    .modern-grid { grid-template-columns: repeat(3, 1fr); }
    .cm-sidebar { display: none; }
    .cm-main { max-width: 100%; padding: 24px; }
    .site-shell { flex-direction: column; }
}

@media (max-width: 900px) {
    .header-nav { display: none; }
    .header-search { width: auto; flex: 1; }
    .app-hero-card { flex-direction: column; text-align: center; }
    .hero-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .modern-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 600px) {
    .cm-main { padding: 18px; }
    .btn-hero { width: 100%; }
    .modern-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .modern-card { padding: 13px 14px; gap: 12px; }
    .card-icon-wrap, .card-icon-wrap img, .placeholder-icon { width: 44px; height: 44px; }
    .card-title { font-size: 12.5px; }
    .screenshots-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
    .screenshot-item { aspect-ratio: 16/9; }
}

@media (max-width: 400px) {
    .modern-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .modern-card { padding: 11px 12px; }
}

/* === LIGHTBOX === */
.cm-lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.cm-lightbox.active { display: flex; opacity: 1; }

.cm-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cm-lightbox.active img { transform: scale(1); }

.lb-close {
    position: absolute;
    top: 25px; right: 25px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.lb-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }

/* === COMMENTS === */
.comment-list { list-style: none; margin: 0 0 40px 0; padding: 0; }
.comment-list li { margin-bottom: 25px; }

.comment-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.comment-meta { margin-bottom: 8px; font-size: 13px; display: flex; justify-content: space-between; }
.comment-author .avatar { border-radius: 50%; width: 40px; height: 40px; }
.comment-author .says { display: none; }
.fn { font-weight: 700; font-style: normal; color: white; font-size: 15px; }
.comment-metadata { margin-left: auto; }
.comment-metadata a { color: var(--text-muted); font-size: 12px; text-decoration: none; }
.comment-content p { margin: 0 0 10px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.reply { text-align: right; width: 100%; margin-top: 10px; }
.comment-reply-link { font-size: 12px; color: var(--blue); font-weight: 600; text-decoration: none; }

.children {
    list-style: none;
    margin-left: 20px;
    margin-top: 20px;
    border-left: 2px solid var(--border);
    padding-left: 20px;
}

.comment-reply-title { font-size: 18px; font-weight: 700; color: white; margin-bottom: 20px; margin-top: 0; }

.comment-inputs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--blue); }

.comment-textarea { margin-bottom: 20px; }
.btn-submit-comment { border: none; cursor: pointer; font-family: inherit; font-size: 14px; }

@media (max-width: 600px) {
    .comment-inputs-row { grid-template-columns: 1fr; gap: 10px; }
}