/* ============================================================
   ConfigHub — Shared Stylesheet (Deovex Dark Theme)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --primary-bg:    #0a0d14;
    --secondary-bg:  #0f1420;
    --card-bg:       #111827;
    --card-hover:    #161f30;
    --text-dark:     #e8eaf0;
    --text-medium:   #b0b8c8;
    --text-light:    #6b7a90;
    --accent-cyan:   #00c8d4;
    --accent-blue:   #1e8fff;
    --accent-glow:   rgba(0, 200, 212, 0.18);
    --accent-gray:   #6b7a90;
    --accent-dark:   #00c8d4;
    --border-color:  rgba(255, 255, 255, 0.07);
    --border-light:  rgba(255, 255, 255, 0.04);
    --border-active: rgba(0, 200, 212, 0.35);
    --shadow-light:  rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-glow:   0 0 20px rgba(0, 200, 212, 0.12);
    --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --error-red:     #ef5350;
    --success-green: #26a69a;
    --font-display:  'Oxanium', sans-serif;
    --font-body:     'DM Sans', sans-serif;
}

/* ── Reset ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Body ── */
body {
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--text-medium);
    line-height: 1.6;
    scroll-behavior: smooth;
    min-height: 100vh;
    padding-top: 64px;
    padding-bottom: 90px;
    background-image:
        linear-gradient(rgba(0,200,212,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,200,212,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Safe-area top bar */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: var(--secondary-bg);
    z-index: 9999;
}

/* Subtle radial accents */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0,200,212,0.04) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(30,143,255,0.03) 0%, transparent 25%);
    pointer-events: none;
    z-index: -1;
}

/* ── Header ── */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 13, 20, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0,200,212,0.08);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 64px;
}

/* ── Logo ── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo i {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    transition: var(--transition);
    filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.logo:hover i {
    transform: rotate(20deg) scale(1.1);
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.03em;
}

.logo-amp {
    color: var(--accent-cyan);
}

/* ── Hamburger toggle ── */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--accent-cyan);
}
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: var(--accent-cyan);
}

/* ── Dropdown ── */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 15px;
    background: #111827;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,200,212,0.12);
    padding: 6px 0;
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    z-index: 999;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.88rem;
    font-family: var(--font-body);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child { border-bottom: none; }

.dropdown-menu a i {
    color: var(--accent-cyan);
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.dropdown-menu a:hover {
    background: rgba(0,200,212,0.07);
    color: var(--text-dark);
    padding-left: 20px;
}

/* ── Content wrapper ── */
.content-section {
    background: transparent;
    min-height: calc(100vh - 64px);
    padding: 20px 0;
}

/* ── Page hero / section header ── */
.post-hero,
.section-header {
    text-align: center;
    padding: 1.5rem 15px 1.8rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.post-hero::after,
.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    border-radius: 2px;
}

.post-hero h1,
.section-header h1 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
}

.post-hero h1 i,
.section-header h1 i {
    color: var(--accent-cyan);
    margin-right: 10px;
    filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.post-hero p,
.section-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Container ── */
.container,
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 2rem;
}

/* ── Cards title ── */
.cards-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
    position: relative;
    display: inline-block;
}

.cards-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), transparent);
    border-radius: 2px;
}

/* ── Mods grid ── */
.mods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
    width: 100%;
}

/* ── Mod card ── */
.mod-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    width: 100%;
    text-decoration: none;
    color: var(--text-medium);
    display: block;
    overflow: hidden;
}

.mod-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,200,212,0.3), transparent);
    opacity: 0;
    transition: var(--transition);
}

.mod-item:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    border-color: var(--border-active);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    color: var(--text-dark);
}

.mod-item:hover::before { opacity: 1; }

.mod-item img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    margin-bottom: 10px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: rgba(0,200,212,0.05);
}

.mod-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0 0 6px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-meta {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* ── Status dots ── */
.status-light {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.green  { background: var(--success-green); box-shadow: 0 0 6px var(--success-green); }
.yellow { background: #f59e0b;              box-shadow: 0 0 6px #f59e0b; }

/* ── Config list ── */
.config-list {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
    width: 100%;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    gap: 1.5rem;
    width: 100%;
    transition: var(--transition);
    animation: slideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.config-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: var(--transition);
}

.config-item:last-child { margin-bottom: 0; }

.config-item:hover {
    background: var(--card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.config-item:hover::before { opacity: 1; }

.config-text { flex: 1; min-width: 0; }

.config-text h3 {
    margin: 0 0 8px;
    color: var(--text-dark);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.config-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0,200,212,0.08);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    gap: 6px;
    border: 1px solid rgba(0,200,212,0.15);
}

.config-badge i { font-size: 0.75rem; color: var(--accent-cyan); }

.config-date {
    color: var(--text-light);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Download button ── */
.file-actions { display: flex; gap: 10px; flex-shrink: 0; }

.download-btn {
    background: rgba(0,200,212,0.08);
    border: 1px solid rgba(0,200,212,0.2);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn i {
    color: var(--accent-cyan);
    font-size: 1.05rem;
    transition: var(--transition);
}

.download-btn:hover {
    background: rgba(0,200,212,0.16);
    border-color: var(--accent-cyan);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(0,200,212,0.2);
}

.download-btn:active { transform: scale(0.96); }

/* ── States ── */
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    margin: 2rem 0;
    width: 100%;
}

.empty-state i { font-size: 2.8rem; color: var(--text-light); margin-bottom: 1.5rem; opacity: 0.5; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.75rem; color: var(--text-dark); font-weight: 600; }
.empty-state p  { color: var(--text-light); max-width: 460px; line-height: 1.6; font-size: 0.9rem; }

.error-state { border-color: rgba(239, 83, 80, 0.2); }
.error-state i  { font-size: 2.8rem; color: var(--error-red); margin-bottom: 1.5rem; opacity: 0.85; }
.error-state h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.75rem; color: var(--text-dark); font-weight: 600; }
.error-state p  { color: var(--text-light); max-width: 460px; line-height: 1.6; font-size: 0.9rem; }

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: var(--accent-cyan);
    width: 100%;
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1.2s linear infinite;
    filter: drop-shadow(0 0 8px var(--accent-cyan));
}

/* ── Retry button ── */
#retryButton {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #0a0d14;
    border: none;
    padding: 11px 26px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#retryButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,200,212,0.35);
}

#retryButton:active { transform: scale(0.97); }

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 1.5rem 15px;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.8rem;
}

.footer p { margin-bottom: 5px; }

/* ── Animations ── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn   { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin      { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Bottom Nav Wrapper ── */
.bottom-nav-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0 16px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    pointer-events: none;
    background: linear-gradient(to top, #0a0d14 55%, transparent);
}

.bottom-nav {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 62px;
    background: rgba(17, 24, 39, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 22px;
    border: 1px solid rgba(0,200,212,0.12);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        0 2px 8px rgba(0,0,0,0.3),
        0 0 0 0.5px rgba(0,200,212,0.06) inset;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    pointer-events: all;
    overflow: visible;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.6rem;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 8px 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    border-radius: 14px;
}

.bottom-nav-item i { font-size: 1.15rem; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

.bottom-nav-item.active          { color: var(--accent-cyan); }
.bottom-nav-item.active i        { transform: translateY(-1px); filter: drop-shadow(0 0 4px var(--accent-cyan)); }
.bottom-nav-item.active .nav-icon-wrap { background: rgba(0,200,212,0.1); }

.nav-icon-wrap {
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item:hover .nav-icon-wrap { background: rgba(0,200,212,0.07); }
.bottom-nav-item:hover               { color: var(--text-dark); }
.bottom-nav-item:active              { transform: scale(0.92); }

/* Upload FAB */
.bottom-nav-upload {
    flex: 1;
    margin-top: -28px;
    gap: 4px;
}

.upload-fab {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,200,212,0.3), 0 2px 6px rgba(0,0,0,0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255,255,255,0.1);
}

.upload-fab i { font-size: 1.2rem; color: #0a0d14; font-weight: 900; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

.bottom-nav-upload:hover .upload-fab {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 10px 28px rgba(0,200,212,0.4), 0 4px 10px rgba(0,0,0,0.3);
    border-radius: 20px;
}

.bottom-nav-upload:hover .upload-fab i { transform: translateY(-1px); }
.bottom-nav-upload span { color: var(--accent-cyan); font-weight: 700; }
.bottom-nav-upload:active .upload-fab  { transform: scale(0.94); }

/* ── Responsive ── */
@media (max-width: 400px) {
    .bottom-nav-wrapper { padding: 0 10px 10px; }
    .bottom-nav         { height: 58px; border-radius: 18px; }
    .bottom-nav-item span { font-size: 0.55rem; }
    .upload-fab         { width: 46px; height: 46px; border-radius: 15px; }
    .bottom-nav-upload  { margin-top: -24px; }
}

@media (max-width: 320px) {
    .mods-grid  { gap: 8px; }
    .mod-item   { padding: 10px; }
    .mod-item img { width: 48px; height: 48px; }
    .mod-name   { font-size: 0.8rem; }
    .post-hero h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .main-container { padding: 0 12px; }
    .section-header h1, .post-hero h1 { font-size: 1.4rem; }
    .config-item    { padding: 14px; flex-wrap: wrap; }
    .config-text h3 { font-size: 0.95rem; }
    .empty-state, .error-state { padding: 2.5rem 1rem; }
    .empty-state i, .error-state i { font-size: 2.5rem; }
    .empty-state h3, .error-state h3 { font-size: 1.2rem; }
    .config-badge   { font-size: 0.72rem; padding: 3px 8px; }
    .config-date    { font-size: 0.75rem; }
    .download-btn   { padding: 10px 12px; min-width: 42px; min-height: 42px; }
}

@media (max-width: 768px) {
    .config-item  { flex-direction: row; align-items: center; gap: 1rem; padding: 15px 14px; }
    .file-actions { width: auto; justify-content: flex-end; }
    .config-meta  { flex-direction: row; align-items: center; gap: 8px; }
    .section-header h1, .post-hero h1 { font-size: 1.6rem; }
    .navbar { padding: 0 12px; }
}

@media (min-width: 768px) {
    .mods-grid   { grid-template-columns: repeat(3, 1fr); gap: 15px; }
    .mod-item    { padding: 16px; }
    .mod-item img { width: 64px; height: 64px; }
    .post-hero h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
    .mods-grid   { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .container, .main-container { max-width: 1200px; }
    .section-header h1, .post-hero h1 { font-size: 2rem; }
}
