/* CS2 Community Server Management System - Main Stylesheet */

:root {
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --dark-bg: #0a0e27;
    --darker-bg: #050814;
    --card-bg: #1a1f3a;
    --hover-bg: #252b4a;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --border-color: #2a3150;
    --success: #00d9a3;
    --danger: #ff4757;
    --warning: #ffa502;
    --ct-color: #5e98d9;
    --t-color: #d9a441;
    
    /* Rarity colors */
    --rarity-consumer: #b0c3d9;
    --rarity-industrial: #5e98d9;
    --rarity-milspec: #4b69ff;
    --rarity-restricted: #8847ff;
    --rarity-classified: #d32ce6;
    --rarity-covert: #eb4b4b;
    --rarity-contraband: #e4ae39;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--darker-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 5px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ffffff;              /* dark mode: chữ TRẮNG */
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;            /* IN ĐẬM */
    letter-spacing: 0.3px;
    border-radius: 12px;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(180deg, rgba(0, 191, 255, 0.25), rgba(204, 68, 255, 0.25));
    transition: width 0.3s ease;
    pointer-events: none;
}

.sidebar-menu a:hover::before,
.sidebar-menu a.active::before {
    width: 100%;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 12px 24px rgba(0,0,0,0.08);
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 18px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.sidebar-menu a:hover i,
.sidebar-menu a.active i {
    transform: translateX(3px);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: var(--darker-bg);
}

/* Page header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* Server Card */
.server-card {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.server-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.85);
    z-index: 0;
}

.server-card > * {
    position: relative;
    z-index: 1;
}

.server-card h4 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success);
}

.status-dot.offline {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.server-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 13px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
    opacity: 0.9;
}

.info-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #ff5722;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #003d6b;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Connect Buttons */
.connect-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.copy-btn {
    position: relative;
}

.copy-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-bg);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.copy-tooltip.show {
    opacity: 1;
}

/* Player List */
.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: grab;
}

.player-item:active {
    cursor: grabbing;
}

.player-item.dragging {
    opacity: 0.5;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid var(--border-color);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.player-rank {
    font-size: 12px;
    color: var(--text-secondary);
}

.player-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.player-ping {
    color: var(--success);
}

/* Team Container */
.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.team-box {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
}

.team-box.ct {
    border-color: var(--ct-color);
}

.team-box.t {
    border-color: var(--t-color);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.team-name {
    font-size: 18px;
    font-weight: 700;
}

.team-count {
    background: var(--hover-bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.skin-item {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.skin-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.skin-item.equipped {
    border-color: var(--success);
}

.skin-item.equipped::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.skin-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.skin-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.skin-weapon {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.skin-rarity {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: var(--hover-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ranking Table */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ranking-table th,
.ranking-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table th {
    background: var(--hover-bg);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.ranking-table tr:hover {
    background: var(--hover-bg);
}

.rank-position {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* Banner Carousel */
.banner-carousel {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.banner-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10, 14, 39, 0.95), transparent);
    padding: 40px;
    color: white;
}

.banner-overlay h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-overlay p {
    font-size: 18px;
    color: var(--text-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dots .dot.active {
    background: var(--primary-color);
    width: 30px;
    border-radius: 6px;
}

.banner-dots .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 4px;
}

.banner-prev:hover,
.banner-next:hover {
    background: var(--primary-color);
}

.banner-prev {
    left: 20px;
}

.banner-next {
    right: 20px;
}

@media (max-width: 768px) {
    .banner-carousel {
        height: 250px;
    }
    
    .banner-overlay h2 {
        font-size: 24px;
    }
    
    .banner-overlay p {
        font-size: 14px;
    }
    
    .banner-prev,
    .banner-next {
        padding: 10px 15px;
        font-size: 18px;
    }
}

/* Global Rajdhani for all page titles */
.db-title,
h1, h2, h3, h4,
.card-title,
.pf-username,
.sv-name {
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.3px;
}
