/* ==========================================================================
   CSS PRINCIPAL - EL BÚNKER HACKER (EBH)
   Estética: Cyberpunk / Blade Runner / Prepper / CRT Terminal
   ========================================================================== */

:root {
    --bg-color: #030407;
    --bg-card: rgba(8, 10, 16, 0.85);
    --bg-card-solid: #080a10;
    
    --neon-cyan: #00f0ff;
    --neon-amber: #ffad00;
    --neon-red: #ff0055;
    --neon-pink: #ff00ea;
    --neon-green: #39ff14;
    
    --text-color: #c7f2ff;
    --text-muted: #53758a;
    
    --font-header: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    
    --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.35);
    --glow-amber: 0 0 10px rgba(255, 173, 0, 0.35);
    --glow-red: 0 0 10px rgba(255, 0, 85, 0.35);
    --glow-green: 0 0 10px rgba(57, 255, 20, 0.35);
}

/* Base resets & scrollbars */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.5px;
    height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 240, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
}

/* ==========================================================================
   BACKGROUND GRID
   ========================================================================== */

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   CYBER CORNERS / BORDERS
   ========================================================================== */

.border-cyber {
    border: 1px solid var(--neon-cyan);
    background-color: var(--bg-card);
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.08), var(--glow-cyan);
    position: relative;
    clip-path: polygon(
        0px 0px, 
        calc(100% - 15px) 0px, 
        100% 15px, 
        100% 100%, 
        15px 100%, 
        0px calc(100% - 15px)
    );
}

.border-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(0, 240, 255, 0.2);
    pointer-events: none;
    clip-path: polygon(
        0px 0px, 
        calc(100% - 15px) 0px, 
        100% 15px, 
        100% 100%, 
        15px 100%, 
        0px calc(100% - 15px)
    );
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.hud-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 20px;
}

/* ==========================================================================
   HUD HEADER
   ========================================================================== */

.hud-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 15px 25px;
    background-color: rgba(6, 8, 14, 0.95);
    border-color: var(--neon-cyan);
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.glitch-title {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    position: relative;
    letter-spacing: 2px;
}

.bunker-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Telemetry HUD Panel */
.telemetry-panel {
    display: flex;
    gap: 20px;
    padding: 8px 15px;
    border-left: 2px solid var(--neon-pink);
    border-right: 2px solid var(--neon-cyan);
    background: rgba(0, 0, 0, 0.4);
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.telemetry-item .label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.telemetry-item .value {
    font-size: 0.9rem;
    font-weight: bold;
    font-family: var(--font-mono);
}

/* Controls */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.clock-display {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--neon-amber);
    text-shadow: var(--glow-amber);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border: 1px solid rgba(255, 173, 0, 0.3);
}

/* ==========================================================================
   MAIN HUD LAYOUT
   ========================================================================== */

.hud-main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ==========================================================================
   BLOG CONTAINER & FEED
   ========================================================================== */

.blog-container {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 150px);
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 240, 255, 0.15);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 15px;
}

.blog-header h2 {
    font-family: var(--font-header);
    font-size: 1.2rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.blog-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.filter-btn.active {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    background: rgba(255, 0, 234, 0.05);
    box-shadow: 0 0 8px rgba(255, 0, 234, 0.2);
}

.blog-feed {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* BLOG CARD */
.blog-card {
    border: 1px solid rgba(0, 240, 255, 0.15);
    background: rgba(5, 7, 12, 0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.blog-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.12), inset 0 0 10px rgba(0, 240, 255, 0.05);
    background: rgba(0, 240, 255, 0.02);
    transform: translateY(-2px);
}

.blog-card::after {
    content: '// SELECT_TO_DECRYPT';
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.blog-card:hover::after {
    opacity: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px dashed rgba(0, 240, 255, 0.1);
    padding-bottom: 6px;
}

.card-meta .category {
    color: var(--neon-amber);
}

.card-title {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: bold;
    color: #fff;
    transition: color 0.2s ease;
}

.blog-card:hover .card-title {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.card-summary {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.85;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}

.card-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
}

.read-btn {
    font-size: 0.75rem;
    color: var(--neon-pink);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-card:hover .read-btn {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

/* ==========================================================================
   SDR PANEL
   ========================================================================== */

.sdr-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 25px;
    flex-wrap: wrap;
    border-color: rgba(57, 255, 20, 0.5);
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.05), var(--glow-green);
}

.sdr-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sdr-icon {
    font-size: 2rem;
    line-height: 1;
}

.sdr-text h2 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: var(--neon-green);
    text-shadow: var(--glow-green);
    letter-spacing: 1px;
}

.sdr-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 2px;
}

.sdr-btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 10px 20px;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    text-shadow: var(--glow-green);
    text-decoration: none;
    background: rgba(57, 255, 20, 0.05);
    transition: all 0.25s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    white-space: nowrap;
}

.sdr-btn:hover {
    background: rgba(57, 255, 20, 0.15);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.35);
    transform: translateY(-1px);
}

/* ==========================================================================
   HUD FOOTER
   ========================================================================== */

.hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 0.75rem;
    background-color: rgba(6, 8, 14, 0.95);
    border-color: rgba(0, 240, 255, 0.4);
}

.hud-footer span {
    letter-spacing: 0.5px;
}

/* ==========================================================================
   MODAL DIALOG (POST VIEWER)
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 3, 5, 0.9);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 95%;
    max-width: 1200px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card-solid);
    border-color: var(--neon-pink);
    box-shadow: inset 0 0 25px rgba(255, 0, 234, 0.05), var(--glow-red);
}

.modal-title-bar {
    background: rgba(255, 0, 85, 0.1);
    border-bottom: 1px solid rgba(255, 0, 85, 0.3);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-text {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--neon-red);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--neon-red);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #fff;
    text-shadow: var(--glow-red);
}

.modal-header-info {
    padding: 25px 30px 15px 30px;
    border-bottom: 1px dashed rgba(0, 240, 255, 0.15);
}

.modal-meta {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.modal-header-info h1 {
    font-family: var(--font-header);
    font-size: 1.6rem;
    color: #fff;
    margin-top: 5px;
}

.modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    flex: 1;
}

/* Styling content inside post details */
.modal-body p {
    margin-bottom: 18px;
    text-align: justify;
}

.modal-body h3 {
    color: var(--neon-cyan);
    font-family: var(--font-header);
    margin: 25px 0 10px 0;
    font-size: 1.1rem;
    border-left: 3px solid var(--neon-cyan);
    padding-left: 10px;
}

.modal-body ul {
    margin: 10px 0 18px 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body code {
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 6px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    font-size: 0.85rem;
}

.modal-body pre {
    background: #020305;
    padding: 15px;
    border: 1px solid rgba(0, 240, 255, 0.15);
    overflow-x: auto;
    margin-bottom: 18px;
}

.modal-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--neon-green);
}

.modal-footer {
    padding: 12px 30px;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.7rem;
}

/* ==========================================================================
   UTILITY HELPER CLASSES & ANIMATIONS
   ========================================================================== */

.txt-cyan { color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.txt-amber { color: var(--neon-amber); text-shadow: var(--glow-amber); }
.txt-warn { color: var(--neon-amber); }
.txt-red { color: var(--neon-red); text-shadow: var(--glow-red); }
.txt-pink { color: var(--neon-pink); }
.txt-green { color: var(--neon-green); }
.txt-muted { color: var(--text-muted); }
.font-bold { font-weight: bold; }
.font-mono { font-family: var(--font-mono); }

.text-glow-cyan { text-shadow: var(--glow-cyan); }
.text-glow-amber { text-shadow: var(--glow-amber); }

/* Pulsing effect */
.pulsing {
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 12px var(--neon-cyan); }
    100% { opacity: 0.6; }
}

/* System alert flicker text */
.flicker-text {
    animation: text-flicker 3s infinite linear;
}

@keyframes text-flicker {
    0%, 100% { opacity: 1; text-shadow: var(--glow-red); }
    41% { opacity: 1; }
    42% { opacity: 0.2; text-shadow: none; }
    43% { opacity: 0.8; }
    45% { opacity: 0.2; }
    46% { opacity: 1; text-shadow: var(--glow-red); }
}

/* Glitch animation details */
@keyframes glitch-anim {
    0% { clip: rect(15px, 9999px, 66px, 0); }
    10% { clip: rect(33px, 9999px, 5px, 0); }
    20% { clip: rect(112px, 9999px, 76px, 0); }
    30% { clip: rect(95px, 9999px, 13px, 0); }
    40% { clip: rect(48px, 9999px, 88px, 0); }
    50% { clip: rect(5px, 9999px, 120px, 0); }
    60% { clip: rect(78px, 9999px, 29px, 0); }
    70% { clip: rect(104px, 9999px, 60px, 0); }
    80% { clip: rect(12px, 9999px, 95px, 0); }
    90% { clip: rect(52px, 9999px, 110px, 0); }
    100% { clip: rect(90px, 9999px, 4px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(44px, 9999px, 5px, 0); }
    10% { clip: rect(12px, 9999px, 88px, 0); }
    20% { clip: rect(90px, 9999px, 22px, 0); }
    30% { clip: rect(71px, 9999px, 110px, 0); }
    40% { clip: rect(5px, 9999px, 60px, 0); }
    50% { clip: rect(130px, 9999px, 95px, 0); }
    60% { clip: rect(53px, 9999px, 12px, 0); }
    70% { clip: rect(85px, 9999px, 78px, 0); }
    80% { clip: rect(110px, 9999px, 40px, 0); }
    90% { clip: rect(25px, 9999px, 120px, 0); }
    100% { clip: rect(62px, 9999px, 30px, 0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 1200px) {
    .blog-container {
        max-height: none;
    }
}

@media (max-width: 800px) {
    .hud-header {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .header-left, .header-right {
        align-items: center;
        text-align: center;
    }
    
    .telemetry-panel {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        border: 1px solid rgba(0, 240, 255, 0.2);
    }
    
    .hud-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }

    .sdr-panel {
        justify-content: center;
        text-align: center;
    }

    .sdr-info {
        flex-direction: column;
        gap: 8px;
    }
}
