/*
Theme Name: Caversia Theme
Theme URI: https://www.caversia.com/
Author: Caversia Team
Description: A native Classic Theme for the Caversia Minecraft Portal.
Version: 3.2.0
*/

/* --- RIOT TECH BASE --- */
html, body { overflow: visible; }
body { margin: 0; background: #050505; font-family: 'Inter', sans-serif; color: #c5c3c0; }
* { box-sizing: border-box; } a { text-decoration: none; color: inherit; }
h1, h2, h3, h4, .label, .nav-link, .logo-text, .btn-action, .tab-link, .btn-copy, .copy-grid-btn, .cat-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; }

/* --- HEADER --- */
.riot-header { height: 80px; width: 100% !important; background: #111; border-bottom: 2px solid #1f1f1f; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; position: fixed; top: 0; left: 0; z-index: 1000; box-sizing: border-box !important; }
.header-left { display: flex; align-items: center; gap: 40px; }
.logo-wrapper { display: flex; align-items: center; gap: 15px; cursor: pointer; }
.logo-mark { width: 40px; height: 40px; background: #eb0029; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.5rem; color: #fff; }
.logo-text { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.05em; color: #fff; }
.riot-nav { display: flex; gap: 30px; }
.nav-link { font-size: 0.9rem; font-weight: 600; color: #999; padding: 10px 0; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: #fff; border-bottom: 3px solid #eb0029; }
.header-right { display: flex; align-items: center; gap: 20px; }
.user-pill { background: #222; padding: 5px 15px 5px 5px; border-radius: 50px; border: 1px solid #333; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: #ccc; }
.u-avatar { width: 30px; height: 30px; background: #eb0029; border-radius: 50%; }

/* --- DISCOVERY BAR --- */
.discovery-bar { background: #0f1012; border-bottom: 1px solid #222; padding: 0 40px; height: 50px; display: flex; align-items: center; position: sticky; top: 80px; z-index: 999; box-shadow: 0 10px 20px rgba(0,0,0,0.5); width: 100% !important; left: 0; box-sizing: border-box !important; }
.discovery-tabs { display: flex; gap: 30px; height: 100%; margin-right: auto; }
.tab-link { display: flex; align-items: center; height: 100%; font-size: 0.85rem; font-weight: 700; color: #888; letter-spacing: 0.05em; transition: 0.2s; cursor: pointer; text-decoration: none; }
.tab-link:hover { color: #fff; }
.tab-link.active { color: #eb0029; border-bottom: 3px solid #eb0029; }
.search-compact { background: #1a1a1c; border: 1px solid #333; padding: 5px 15px; border-radius: 4px; display: flex; align-items: center; gap: 10px; width: 250px; }
.search-compact input { background: transparent; border: none; color: #fff; width: 100%; outline: none; font-family: 'Inter', sans-serif; font-size: 0.85rem; }

/* --- LAYOUT --- */
.hub-container { width: 70%; max-width: 1920px; margin: 0 auto 40px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 60px; margin-top: 130px !important; }

/* --- DASHBOARD LAYOUT --- */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    width: 80%;
    max-width: 1600px;
    margin: 40px auto;
    margin-top: 130px !important;
}

/* --- HERO --- */
.portal-hero { display: flex; height: 450px; background: #0f1116; box-shadow: 0 0 30px rgba(0,0,0,0.8); cursor: pointer; border: 1px solid #333; }
.hero-media { flex: 2.5; position: relative; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-info { flex: 1; padding: 30px 30px 0 30px; display: flex; flex-direction: column; background: #111; border-left: 1px solid #222; position: relative; justify-content: flex-start; gap: 20px; }
.rank-badge { background: #eb0029; color: #fff; padding: 4px 10px; border-radius: 2px; font-weight: 700; font-size: 0.8rem; display: inline-block; margin-bottom: 15px; width: fit-content; }

.hero-title { font-size: 2.5rem; margin: 0 0 5px 0; color: #fff; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.hero-title.text-long { font-size: 2rem; }
.hero-title.text-super-long { font-size: 1.5rem; line-height: 1.2; }
.hero-meta { color: #8f98a0; font-size: 0.9rem; line-height: 1.4; margin-bottom: 15px; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 4px 8px; border-radius: 2px; font-size: 0.75rem; color: #c6d4df; font-weight: 600; transition: 0.2s; }
.tag:hover { background: rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.1); color: #fff; }

.server-stats { margin-top: auto; margin-left: -30px; margin-right: -30px; padding: 20px 30px; background: #1a1a1c; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.stat-item { font-size: 0.9rem; color: #fff; font-weight: 600; }
.stat-item i { color: #eb0029; margin-right: 5px; }
.btn-copy { background: #eb0029; color: #fff; border: none; padding: 8px 16px; font-weight: 700; cursor: pointer; border-radius: 2px; transition: 0.2s; }
.btn-copy:hover { background: #ff0a3b; }

/* --- SECTIONS & GRIDS --- */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.sec-title { font-size: 1.4rem; color: #fff; margin: 0; letter-spacing: 0.05em; }
.sec-link { font-size: 0.8rem; border: 1px solid #333; padding: 5px 10px; border-radius: 4px; color: #fff; transition: 0.2s; font-weight:700; }
.sec-link:hover { border-color: #fff; }

.spotlight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.server-card { background: #16191e; height: 300px; position: relative; cursor: pointer; overflow: hidden; border: 1px solid transparent; transition: 0.2s; display: flex; flex-direction: column; }
.server-card:hover { transform: translateY(-5px); border-color: #eb0029; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.card-media-wrap { position: relative; width: 100%; height: 145px; overflow: hidden; flex-shrink: 0; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }

/* Global Card Hover State */
.server-card:hover .card-img { transform: scale(1.05); filter: brightness(1.1); }

.card-rank { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.8); color: #fff; font-weight: 700; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; border: 1px solid #333; z-index: 2; }
.card-body { padding: 12px 15px 15px 15px; display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1; height: auto; }
.card-info { width: 100%; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 2px; }
.card-title-row a { flex: 1; overflow: hidden; text-decoration: none; color: inherit; }
.card-title-row h4 { margin: 0; font-size: 1.05rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ip-sm { font-size: 0.75rem; color: #555; font-family: 'Inter', sans-serif; font-weight: 600; text-transform: none; flex-shrink: 0; }

.card-stats-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: auto; 
    padding-top: 13px; 
    border-top: 1px solid rgba(255,255,255,0.05);
}
.card-pop { text-align: left; }
.pop-count { color: #39FF14; font-weight: 700; font-size: 0.95rem; display: block; line-height: 1; }
.pop-label { font-size: 0.65rem; color: #666; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }

.btn-submit-aaa { 
    background: #eb0029; 
    color: #fff; 
    padding: 18px 50px; 
    border: none; 
    font-weight: 800; 
    text-transform: uppercase; 
    cursor: pointer; 
    font-size: 1.1rem; 
    font-family: 'Oswald', sans-serif; 
    letter-spacing: 0.1em;
    transition: 0.2s; 
    border-radius: 4px;
}
.btn-submit-aaa:hover { background: #ff0a3b; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(235,0,41,0.3); }

.btn-icon-copy {
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.btn-icon-copy:hover {
    background: #eb0029;
    color: #fff;
    border-color: #eb0029;
    transform: scale(1.1);
}

.server-content-body { 
    color: #ccc; 
    line-height: 1.8; 
    font-size: 1.1rem; 
    background: rgba(255,255,255,0.02); 
    padding: 40px; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.05);
}
.server-content-body h3 { 
    color: #fff; 
    font-family: 'Oswald', sans-serif; 
    text-transform: uppercase; 
    margin: 35px 0 15px 0; 
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    border-left: 4px solid #eb0029;
    padding-left: 15px;
}
.server-content-body h3:first-child { margin-top: 0; }
.server-content-body p { margin-bottom: 20px; }
.server-content-body ul { margin-bottom: 25px; padding-left: 20px; list-style: none; }
.server-content-body li { position: relative; margin-bottom: 10px; padding-left: 25px; }
.server-content-body li::before { 
    content: '\f00c'; 
    font-family: 'Font Awesome 6 Free'; 
    font-weight: 900; 
    position: absolute; 
    left: 0; 
    color: #39FF14; 
    font-size: 0.9rem;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    width: 80%;
    max-width: 1600px;
    margin: 40px auto;
    margin-top: 130px !important;
}

.dashboard-sidebar {
    background: #0F0F0F;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 30px 0;
    height: fit-content;
}

.user-brief {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 25px 25px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 20px;
}

.dash-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #eb0029;
}

.user-meta .user-name {
    display: block;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.user-meta .user-rank {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-nav {
    display: flex;
    flex-direction: column;
}

.dash-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: #888;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

.dash-link i {
    width: 20px;
    text-align: center;
}

.dash-link:hover, .dash-link.active {
    color: #fff;
    background: rgba(255,255,255,0.03);
    border-left-color: #eb0029;
}

.dash-link.logout:hover {
    color: #eb0029;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 15px 25px;
}

.dashboard-content {
    min-height: 600px;
}

.content-card {
    background: #0F0F0F;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 40px;
}

.dashboard-content h2 {
    color: #fff;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 25px;
}

/* --- FORM STYLES --- */
.mms-label { 
    display: block; 
    color: #888; 
    margin-bottom: 8px; 
    font-weight: 700; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}
.mms-input { 
    width: 100%; 
    background: #050505; 
    border: 1px solid #222; 
    color: #fff; 
    padding: 12px 15px; 
    box-sizing: border-box; 
    border-radius: 4px; 
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: 0.2s; 
}
.mms-input:focus { 
    border-color: #eb0029; 
    outline: none; 
    background: #0a0a0a;
}

/* --- CAROUSEL --- */
.cat-carousel-wrap { position: relative; margin-bottom: 40px; }
.cat-track { display: flex; gap: 15px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 10px; }
.cat-track::-webkit-scrollbar { display: none; }
.cat-card { min-width: 180px; height: 100px; position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid #222; transition: 0.2s; flex-shrink: 0; }
.cat-card:hover { border-color: #fff; transform: scale(1.05); }
.cat-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
.cat-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); }
.cat-title { color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: 0.05em; text-shadow: 0 2px 5px black; }
.carousel-nav { display: flex; gap: 10px; }
.nav-arrow { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; width: 32px; height: 32px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.nav-arrow:hover { background: #eb0029; border-color: #eb0029; }

/* --- RESOURCE HUB TABS --- */
.resource-tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid #333; }
.res-tab { padding: 10px 20px; background: #16191e; color: #888; font-weight: 700; cursor: pointer; border-top-left-radius: 4px; border-top-right-radius: 4px; transition:0.2s; }
.res-tab:hover { color:#fff; background:#222; }
.res-tab.active { background: #eb0029; color: #fff; }
.pack-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.pack-card { background: #16191e; border: 1px solid #222; border-radius: 8px; overflow: hidden; transition: 0.2s; cursor: pointer; }
.pack-card:hover { border-color: #fff; transform:translateY(-5px); }
.pack-thumb { height: 120px; width: 100%; object-fit: cover; }
.pack-info { padding: 10px; }
.pack-title { font-size: 0.9rem; font-weight: 700; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pack-ver { font-size: 0.75rem; color: #666; }

/* --- GUILD/CREATOR STYLES --- */
.guild-card { display: flex; align-items: center; gap: 15px; padding: 15px; background: #16191e; border: 1px solid #222; border-radius: 8px; transition: 0.2s; cursor: pointer; }
.guild-card:hover { border-color: #0ac8b9; transform: translateX(5px); }
.guild-icon { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.guild-meta h4 { margin: 0; color: #fff; font-size: 1.1rem; }
.guild-meta span { color: #888; font-size: 0.85rem; }

/* --- LIST ROWS --- */
.list-filter { display: flex; gap: 15px; margin-bottom: 20px; }
.filter-tab { padding: 5px 15px; background: #1a1a1c; color: #888; font-size: 0.85rem; border-radius: 20px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.filter-tab.active, .filter-tab:hover { background: #eb0029; color: #fff; }
.server-row { display: flex; height: 65px; background: rgba(255,255,255,0.03); margin-bottom: 5px; align-items: center; padding: 0 20px; transition: 0.2s; cursor: pointer; border: 1px solid transparent; }
.server-row:hover { background: rgba(255,255,255,0.08); border-color: #444; }
.row-rank { width: 40px; font-weight: 700; color: #666; font-size: 1.1rem; }
.row-img { width: 120px; height: 45px; object-fit: cover; margin-right: 20px; background: #000; border-radius: 2px; }
.row-name { flex: 1; font-weight: 700; color: #c5c3c0; font-size: 1rem; }
.row-tags { flex: 1; display: flex; gap: 5px; }
.row-stat { width: 120px; text-align: right; color: #8f98a0; font-size: 0.85rem; }
.row-copy { width: 100px; text-align: right; }
.btn-small-copy { background: rgba(255,255,255,0.1); color: #fff; border: none; padding: 5px 10px; font-size: 0.7rem; border-radius: 2px; cursor: pointer; font-weight: 700; transition: 0.2s; }
.btn-small-copy:hover { background: #eb0029; }

/* --- FOOTER --- */
.riot-footer {
    background: #111;
    border-top: 2px solid #1f1f1f;
    padding: 80px 0 40px 0;
    margin-top: 100px;
}
.footer-container {
    width: 70%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}
.footer-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 25px;
    letter-spacing: 0.1em;
}
.footer-about {
    color: #888;
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 400px;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: #666;
    font-size: 0.9rem;
    transition: 0.2s;
    font-weight: 600;
}
.footer-links a:hover {
    color: #eb0029;
    padding-left: 5px;
}
.footer-bottom {
    border-top: 1px solid #222;
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
    font-size: 0.85rem;
}
.social-links {
    display: flex;
    gap: 20px;
}
.social-links a {
    color: #444;
    font-size: 1.2rem;
    transition: 0.2s;
}
.social-links a:hover {
    color: #fff;
}

/* Admin Bar Adjustments */
body.admin-bar .riot-header { top: 32px !important; }
body.admin-bar .discovery-bar { top: 112px !important; }

/* --- CINEMA MODAL SYSTEM --- */
.mms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 200000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.mms-modal-overlay.active { display: flex; }
.mms-modal-window {
    background: #0f1116;
    border: 1px solid #333;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    position: relative;
    animation: modalSlide 0.3s ease-out;
}
@keyframes modalSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.mms-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mms-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}
.mms-modal-close:hover { color: #fff; transform: rotate(90deg); }
.mms-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

/* Timeline in Modal */
.modal-timeline { position: relative; padding-left: 30px; }
.modal-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #c8aa6e, transparent);
}
.timeline-date-header {
    position: sticky;
    top: -30px;
    background: #0f1116;
    padding: 10px 0;
    color: #c8aa6e;
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    z-index: 10;
    margin-bottom: 20px;
}
.timeline-item {
    margin-bottom: 40px;
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #c8aa6e;
    border-radius: 50%;
    box-shadow: 0 0 10px #c8aa6e;
}
.timeline-item h4 { margin: 0 0 10px 0; font-size: 1.2rem; color: #fff; }
.timeline-item .meta { font-size: 0.75rem; color: #666; margin-bottom: 15px; display: block; }
.timeline-item .content { color: #ccc; line-height: 1.6; font-size: 0.95rem; }

@media screen and (max-width: 782px) {
    body.admin-bar .riot-header { top: 46px !important; }
    body.admin-bar .discovery-bar { top: 126px !important; }
}