/* styles.css - Strix Dojo Theme */
:root {
    --bg-dark: #0f111a;
    --card-bg: #1e212b;
    --primary: #00ff88;
    /* Verde Hacker */
    --accent: #e63946;
    /* Rojo Strix */
    --text: #e0e6ed;
    --text-muted: #94a3b8;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
}

/* Header */
header {
    background: rgba(30, 33, 43, 0.9);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

/* Hero Section con tu Ninja */
.hero {
    background: linear-gradient(rgba(15, 17, 26, 0.7), var(--bg-dark)), url('assets/ciberninja.jpg');
    background-size: cover;
    background-position: center top;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: bold;
}

/* Grid de Tarjetas */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.section-title {
    border-left: 4px solid var(--accent);
    padding-left: 15px;
    margin-bottom: 30px;
}

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #333;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.1);
    border-color: var(--primary);
}

.card-body {
    padding: 20px;
    flex-grow: 1;
}

.card-tags {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    font-size: 0.8rem;
    font-weight: bold;
}

.diff-easy {
    color: var(--primary);
}

.diff-hard {
    color: var(--accent);
}

.locked {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* Estilos para el Blog Post */
.blog-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 10px;
    margin-top: -50px;
    position: relative;
    border: 1px solid #333;
}

.code-block {
    background: #000;
    padding: 15px;
    border-left: 3px solid var(--primary);
    font-family: monospace;
    color: var(--primary);
    margin: 20px 0;
    overflow-x: auto;
}

.btn-action {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--accent);
    color: white;
    padding: 15px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 30px;
    transition: background 0.3s;
}

.btn-action:hover {
    background: #c53030;
}

/* App Layout for SaaS Sidebar */
.app-layout {
    display: flex;
    min-height: calc(100vh - 66px);
}

/* Sidebar pegado a la izquierda */
.app-sidebar {
    width: 280px;
    background: rgba(20, 23, 33, 0.98);
    border-right: 1px solid #334155;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.app-sidebar .section-title {
    margin-top: 0;
    margin-bottom: 25px;
}

/* Area Principal que tiene scroll natural si hace falta */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.title-neon {
    border-left-color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Leaderboard Sidebar sin card wrapper pesada */
.leaderboard-card-sidebar {
    background: transparent;
    border: none;
    box-shadow: none;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.leaderboard-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.leaderboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.col-rank {
    width: 50px;
    font-weight: bold;
    color: var(--text-muted);
}

.col-user {
    font-family: monospace;
    color: var(--text);
}

.col-xp {
    text-align: right;
    color: var(--primary);
    font-weight: bold;
}

/* Podium Colors */
.rank-gold {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.rank-silver {
    color: #cbd5e1;
    text-shadow: 0 0 8px rgba(203, 213, 225, 0.4);
}

.rank-bronze {
    color: #b45309;
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #334155;
    }

    .challenge-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1300px) {
    .challenge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}