/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cyber-primary: #00ff88;
    --cyber-secondary: #00d4ff;
    --cyber-accent: #7b2cbf;
    --cyber-danger: #ff006e;
    --cyber-bg-dark: #0a0e1a;
    --cyber-bg-medium: rgba(15, 22, 36, 0.75);
    --cyber-bg-light: rgba(26, 35, 50, 0.75);
    --cyber-text: #ffffff;
    --cyber-text-dim: #c0c8d0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--cyber-bg-dark);
    color: var(--cyber-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-image 0.5s ease-in-out;
}

/* Background Dinâmico com Overlay Suave */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 14, 26, 0.25);
    /* Overlay muito suave */
    z-index: -1;
}

/* Backgrounds Específicos */
body.bg-ciberseguranca {
    background-image: url('img/bg-ciberseguranca.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.bg-totvs {
    background-image: url('img/bg-totvs.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Scanline effect suave */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 50%,
            rgba(0, 255, 136, 0.01) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(4px);
    }
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header com transparência */
header {
    background: rgba(15, 22, 36, 0.3);
    backdrop-filter: blur(5px);
    color: var(--cyber-text);
    padding: 2.5rem 0;
    border-bottom: 2px solid rgba(0, 255, 136, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 255, 136, 0.05),
            transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--cyber-primary);
    text-shadow:
        0 0 20px rgba(0, 255, 136, 0.6),
        0 0 40px rgba(0, 255, 136, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    position: relative;
}

.header-content h1::after {
    content: '_';
    animation: blink 1s infinite;
    color: var(--cyber-primary);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.header-content p {
    color: var(--cyber-text);
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Tabs de Navegação */
.tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(0, 255, 136, 0.15);
    backdrop-filter: blur(5px);
    border: 2px solid var(--cyber-primary);
    color: var(--cyber-primary);
    padding: 12px 30px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 0;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tab-btn:hover::before {
    width: 300px;
    height: 300px;
}

.tab-btn:hover {
    background: rgba(0, 255, 136, 0.25);
    transform: translateY(-3px);
    box-shadow:
        0 5px 20px rgba(0, 255, 136, 0.5),
        inset 0 0 20px rgba(0, 255, 136, 0.1);
    color: #ffffff;
}

.tab-btn.active {
    background: var(--cyber-primary);
    color: var(--cyber-bg-dark);
    border-color: var(--cyber-primary);
    box-shadow:
        0 0 30px rgba(0, 255, 136, 0.8),
        0 0 60px rgba(0, 255, 136, 0.4);
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8), 0 0 60px rgba(0, 255, 136, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 255, 136, 1), 0 0 80px rgba(0, 255, 136, 0.6);
    }
}

/* Main Content */
main {
    padding: 3rem 0;
    flex: 1;
    position: relative;
    z-index: 2;
}

#status-bar {
    text-align: right;
    font-size: 0.9rem;
    color: var(--cyber-text);
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 1rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#status-bar span {
    color: var(--cyber-primary);
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Cards com transparência */
.card {
    background: rgba(15, 22, 36, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 0;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 1px rgba(0, 255, 136, 0.3);
    padding: 2rem;
    transition: all 0.4s ease;
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-left: 4px solid var(--cyber-primary);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 255, 136, 0.1),
            transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--cyber-primary);
    background: rgba(15, 22, 36, 0.85);
    box-shadow:
        0 10px 40px rgba(0, 255, 136, 0.4),
        0 0 30px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 255, 136, 0.05);
}

.card-body p {
    color: var(--cyber-text);
    font-size: 1.15rem;
    /* Aumentado para melhor leitura */
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-line;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.card h3 {
    font-size: 1.5rem;
    margin: 15px 0;
    color: var(--cyber-primary);
    line-height: 1.4;
    font-weight: 700;
    text-shadow:
        0 0 10px rgba(0, 255, 136, 0.5),
        1px 1px 3px rgba(0, 0, 0, 0.7);
}

.card-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
    border: 1px solid currentColor;
    background: rgba(0, 255, 136, 0.15);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.card-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.source-info {
    font-size: 1rem;
    color: var(--cyber-text);
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.source-info strong {
    color: var(--cyber-secondary);
}

/* Botão de Ler Mais */
.read-more-btn {
    display: inline-block;
    background: rgba(0, 255, 136, 0.1);
    color: var(--btn-color, var(--cyber-primary));
    padding: 10px 20px;
    border-radius: 0;
    border: 2px solid var(--btn-color, var(--cyber-primary));
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    z-index: 1;
    /* Ensure button content is above background */
    isolation: isolate;
    /* Create new stacking context */
}

.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--btn-color, var(--cyber-primary));
    transition: left 0.3s;
    z-index: -1;
    /* Behind the text */
}

.read-more-btn:hover::before {
    left: 0;
}

.read-more-btn:hover {
    color: #000000 !important;
    /* Force black text for maximum contrast */
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

.data-noticia {
    font-size: 0.85rem;
    color: var(--cyber-text);
    display: block;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Loading e Mensagens */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--cyber-text);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.error-box {
    background: rgba(255, 0, 110, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid var(--cyber-danger);
    padding: 2rem;
    border-radius: 0;
    color: var(--cyber-text);
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
}

/* Footer */
footer {
    background: rgba(15, 22, 36, 0.7);
    backdrop-filter: blur(10px);
    color: var(--cyber-text);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 2px solid rgba(0, 255, 136, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

footer p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Responsividade */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-btn {
        width: 100%;
    }
}

/* Efeitos de glitch */
@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

.card:hover h3 {
    animation: glitch 0.3s;
}