@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Montserrat:wght@300;400;600;800&family=Permanent+Marker&display=swap');

@font-face {
    font-family: 'Misproject';
    src: url('../fonts/misproject/MISPROJE.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-dark: #0a0606;
    --bg-card: #150d0d;
    --bg-card-hover: #1f1414;
    --border-color: #2b1717;
    --border-glow: rgba(198, 40, 40, 0.25);
    
    --primary-red: #d32f2f;
    --primary-glow: rgba(211, 47, 47, 0.6);
    --dark-red: #8e0000;
    --neon-green: #388e3c;
    --neon-orange: #f57c00;
    
    --text-main: #f5f5f5;
    --text-muted: #b0bec5;
    --text-dark: #78909c;
    
    --font-heading: 'Misproject', 'Permanent Marker', sans-serif;
    --font-logo: 'Creepster', cursive;
    --font-body: 'Montserrat', sans-serif;
    
    --transition-speed: 0.25s;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    padding-bottom: 50px;
    background-image: 
        radial-gradient(circle at 50% 10%, rgba(142, 0, 0, 0.15) 0%, transparent 60%),
        linear-gradient(rgba(10, 6, 6, 0.85), rgba(10, 6, 6, 0.85)),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E"),
        url('../images/bg.jpg');
    background-attachment: fixed;
    background-size: auto, auto, auto, cover;
    background-position: center;
}

a {
    color: var(--primary-red);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: #ff6659;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- NAVIGATION --- */
.nav-header {
    background: rgba(15, 9, 9, 0.9);
    border-bottom: 2px solid var(--dark-red);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 1px 15px var(--border-glow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand-text {
    font-family: var(--font-logo);
    font-size: 2.2rem;
    color: var(--primary-red);
    text-shadow: 0 0 10px var(--primary-glow);
    letter-spacing: 2px;
}

.nav-brand-text span {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-item {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all var(--transition-speed);
    text-transform: uppercase;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(211, 47, 47, 0.1);
    border-color: var(--dark-red);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.2);
}

/* Server Widget inside Nav */
.server-widget {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    max-width: 320px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-red);
    animation: pulse 1.8s infinite;
}

.status-dot.offline {
    background-color: var(--text-dark);
    box-shadow: none;
    animation: none;
}

.server-info-text {
    flex: 1;
    overflow: hidden;
}

.server-name {
    color: var(--text-main);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-map {
    color: var(--text-muted);
}

.server-map span {
    color: var(--primary-red);
    font-weight: 600;
}

.server-connect-btn {
    background: var(--dark-red);
    color: var(--text-main);
    border: 1px solid var(--primary-red);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-speed);
}

.server-connect-btn:hover {
    background: var(--primary-red);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* --- BREADCRUMB --- */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
}

.breadcrumb a {
    color: var(--text-dark);
}

.breadcrumb a:hover {
    color: var(--primary-red);
}

/* --- PAGE HEADER --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    color: var(--text-main);
}

/* Search bar */
.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 240px;
    transition: all var(--transition-speed);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 8px var(--border-glow);
}

.btn-primary {
    background: var(--dark-red);
    color: var(--text-main);
    border: 1px solid var(--primary-red);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-primary:hover {
    background: var(--primary-red);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* --- CARDS & PANELS --- */
.l4d-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.l4d-card:hover {
    border-color: rgba(211, 47, 47, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 15px rgba(211, 47, 47, 0.15);
}

/* --- TABLES / LEADERBOARD --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.l4d-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    text-align: left;
}

.l4d-table th {
    background: rgba(142, 0, 0, 0.15);
    border-bottom: 2px solid var(--dark-red);
    color: var(--text-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 12px 15px;
}

.l4d-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: middle;
}

.l4d-table tbody tr {
    transition: background-color var(--transition-speed);
}

.l4d-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.l4d-table tbody tr.top-row {
    background-color: rgba(211, 47, 47, 0.03);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.rank-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-link {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.page-link:hover, .page-link.active {
    background: var(--dark-red);
    color: var(--text-main);
    border-color: var(--primary-red);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* --- PLAYER PROFILE DASHBOARD --- */
.profile-header {
    background: linear-gradient(135deg, #1f1111 0%, #0f0909 100%);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-red);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    gap: 25px;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid var(--primary-red);
    object-fit: cover;
    box-shadow: 0 0 15px var(--primary-glow);
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    color: var(--text-main);
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    margin-bottom: 5px;
}

.profile-meta-row {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.profile-meta-row span strong {
    color: var(--text-main);
}

.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.vip {
    color: #ffd700;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

.badge.points {
    color: var(--neon-orange);
    border-color: var(--neon-orange);
}

/* Stats Grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.stats-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    color: var(--primary-red);
    letter-spacing: 0.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
    font-size: 0.95rem;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text-main);
}

/* Progress bar inside stats */
.progress-bar-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    height: 8px;
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-red);
    box-shadow: 0 0 5px var(--primary-glow);
    border-radius: 4px;
}

/* --- POINT SHOP --- */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.shop-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.shop-tab-btn:hover, .shop-tab-btn.active {
    background: var(--dark-red);
    color: var(--text-main);
    border-color: var(--primary-red);
    box-shadow: 0 0 10px var(--primary-glow);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.shop-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-speed);
}

.shop-item-card:hover {
    border-color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.15);
}

.shop-item-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 8px;
}

.shop-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex-grow: 1;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.shop-item-price {
    font-weight: bold;
    color: var(--neon-orange);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.1rem;
}

.shop-item-stock {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-transform: uppercase;
}

/* --- ACHIEVEMENTS PAGE --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    opacity: 0.65;
    transition: all var(--transition-speed);
}

.achievement-card.unlocked {
    opacity: 1;
    border-color: rgba(56, 142, 60, 0.4);
    box-shadow: 0 4px 15px rgba(56, 142, 60, 0.1);
}

.achievement-card.unlocked::before {
    content: 'UNLOCKED';
    position: absolute;
    top: 10px;
    right: -25px;
    background: var(--neon-green);
    color: white;
    font-size: 0.55rem;
    font-weight: bold;
    padding: 3px 25px;
    transform: rotate(45deg);
    box-shadow: 0 0 5px rgba(56, 142, 60, 0.5);
}

.achievement-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.achievement-card.unlocked .achievement-title {
    color: #a5d6a7;
    text-shadow: 0 0 5px rgba(56, 142, 60, 0.3);
}

.achievement-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.achievement-category {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* Footer styling */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-dark);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

footer a {
    color: var(--text-muted);
}
