/* --- CSS VARIABLES & RESET --- */
:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-input: rgba(15, 23, 42, 0.8);
    --border-color: rgba(51, 65, 85, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --accent-emerald: #10b981;
    --accent-indigo: #818cf8;
    --accent-brand: #38bdf8;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- LAYOUT & CONTAINER --- */
main.container {
    flex: 1;
    max-width: 1024px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* --- NAVIGATION --- */
.navbar {
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;

    .nav-container {
        max-width: 1024px;
        margin: 0 auto;
        padding: 0 1rem;
        height: 4rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .brand {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--accent-brand);
    }

    .nav-links {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        font-size: 0.875rem;
        color: var(--text-muted);

        a:hover { color: var(--text-main); }
    }
}

/* --- BUTTONS & BADGES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;

    &-primary {
        background-color: var(--accent-emerald);
        color: #022c22;
        width: 100%;
        padding: 0.75rem 1rem;
        &:hover { opacity: 0.9; }
    }

    &-outline-emerald {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.3);
        color: var(--accent-emerald);
        &:hover { background: rgba(16, 185, 129, 0.2); }
    }

    &-outline-subtle {
        border-color: var(--border-color);
        color: var(--text-muted);
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        &:hover { background: rgba(51, 65, 85, 0.5); }
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;

    &.online {
        background: rgba(16, 185, 129, 0.1);
        color: var(--accent-emerald);
        border: 1px solid rgba(16, 185, 129, 0.2);
    }
    &.offline {
        background: rgba(244, 63, 94, 0.1);
        color: #fb7185;
        border: 1px solid rgba(244, 63, 94, 0.2);
    }

    .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: currentColor;
    }
}

/* --- CARDS & GRID --- */
.card-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

.grid-articles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
    @media (min-width: 1024px) { grid-template-columns: repeat(3, 1fr); }
}

.article-card {
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;

    &:hover {
        border-color: rgba(129, 140, 248, 0.5);
        transform: translateY(-2px);
    }

    .category {
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--accent-indigo);
        background: rgba(129, 140, 248, 0.1);
        border: 1px solid rgba(129, 140, 248, 0.2);
        padding: 0.125rem 0.625rem;
        border-radius: 9999px;
        align-self: flex-start;
        margin-bottom: 0.75rem;
    }

    h3 {
        font-size: 1.25rem;
        color: #fff;
        margin-bottom: 0.5rem;
    }

    p {
        color: var(--text-muted);
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
        font-size: 0.75rem;

        .date { color: var(--text-subtle); }
        .link { color: var(--accent-indigo); font-weight: 600; }
    }
}

/* --- FORMS & LOGIN --- */
.login-wrapper {
    max-width: 28rem;
    margin: 3rem auto;
}

.form-group {
    margin-bottom: 1rem;
    label {
        display: block;
        font-size: 0.875rem;
        color: var(--text-muted);
        margin-bottom: 0.375rem;
    }
    input {
        width: 100%;
        padding: 0.625rem 1rem;
        border-radius: 0.75rem;
        background-color: var(--bg-input);
        border: 1px solid var(--border-color);
        color: #fff;
        font-size: 0.875rem;
        &:focus {
            outline: none;
            border-color: var(--accent-emerald);
        }
    }
}

/* --- FLASH MESSAGES --- */
.flash-container {
    margin-bottom: 1.5rem;
    .flash {
        padding: 1rem;
        border-radius: 0.75rem;
        font-size: 0.875rem;
        border: 1px solid;
        margin-bottom: 0.5rem;

        &.success { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
        &.error { background: rgba(244, 63, 94, 0.1); color: #fda4af; border-color: rgba(244, 63, 94, 0.3); }
        &.info { background: rgba(56, 189, 248, 0.1); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }
    }
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-subtle);
}


/* static/css/style.css */
.social-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background-color:var(--bg-card);
    border: 1px solid var(--border-color);
    color:var(--text-subtle);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.social-badge:hover {
    transform: translateY(-2px);
    background-color: #e4e4e7;
}

.social-badge-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
