/* 
   ==========================================================================
   PORTAL SEGURO - BULMA CUSTOM THEME OVERRIDES
   Aesthetic: Cybertech Dark / Glassmorphism / CTF
   ========================================================================== 
*/

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@400;500;700&family=Fira+Code:wght@400;600&display=swap');

:root {
    /* Custom Color Variables */
    --bg-dark: #090d16;
    --bg-light: #0f172a;
    --card-bg: rgba(22, 30, 49, 0.65);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --accent: #f43f5e;
    --accent-hover: #e11d48;
    --accent-glow: rgba(244, 63, 94, 0.25);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.08);

    /* Clearance Badges Colors */
    --clearance-low: #38bdf8;
    --clearance-medium: #34d399;
    --clearance-high: #fb923c;
    --clearance-critical: #f87171;
    --clearance-max: #c084fc;
}

/* ==========================================================================
   1. Global Resets & Bulma Overrides
   ========================================================================== */

html, body {
    background: radial-gradient(circle at center, #1e1b4b 0%, var(--bg-dark) 100%) !important;
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif !important;
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography */
.title, .subtitle, h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif !important;
    color: var(--text-main) !important;
}

.title {
    font-weight: 700 !important;
}

.subtitle {
    color: var(--text-muted) !important;
}

code {
    font-family: 'Fira Code', monospace !important;
    background-color: rgba(9, 13, 22, 0.5) !important;
    color: var(--accent) !important;
}

/* ==========================================================================
   2. Bulma Card & Glassmorphism Overrides
   ========================================================================== */

.card {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    border-radius: 28px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    position: relative;
    overflow: hidden;
    color: var(--text-main) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Glowing top bar on cards */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 10;
}

.card-header {
    background-color: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.5rem 2rem !important;
}

.card-header-title {
    color: var(--text-main) !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
}

.card-content {
    padding: 2.5rem !important;
}

.card-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1.5rem 2rem !important;
}

/* ==========================================================================
   3. Bulma Buttons Overrides
   ========================================================================== */

.button {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    height: auto !important;
    padding: 12px 24px !important;
}

.button.is-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 14px var(--primary-glow) !important;
}

.button.is-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow) !important;
    filter: brightness(1.1);
}

.button.is-primary:active {
    transform: translateY(0);
}

.button.is-link {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25) !important;
}

.button.is-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25) !important;
    filter: brightness(1.1);
}

.button.is-light {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

.button.is-light:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    transform: translateY(-2px);
}

.button.is-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.button.is-danger:hover {
    background: var(--danger) !important;
    color: white !important;
    border-color: var(--danger) !important;
    box-shadow: 0 6px 18px var(--danger-glow) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   4. Bulma Form Elements Overrides
   ========================================================================== */

.label {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    font-weight: 600 !important;
}

.input {
    background-color: rgba(9, 13, 22, 0.7) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    height: auto !important;
    transition: all 0.3s ease !important;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.25) !important;
}

.input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background-color: rgba(9, 13, 22, 0.9) !important;
}

/* ==========================================================================
   5. Bulma Tags & Badges
   ========================================================================== */

.tag {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 9999px !important;
    padding: 0.5em 1em !important;
    height: auto !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.tag.is-link {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.tag.is-primary {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #c084fc !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

/* Clearance Tags */
.tag-clearance-low {
    background: rgba(56, 189, 248, 0.1) !important;
    color: var(--clearance-low) !important;
    border-color: rgba(56, 189, 248, 0.2) !important;
}

.tag-clearance-medium {
    background: rgba(52, 211, 153, 0.1) !important;
    color: var(--clearance-medium) !important;
    border-color: rgba(52, 211, 153, 0.2) !important;
}

.tag-clearance-high {
    background: rgba(251, 146, 60, 0.1) !important;
    color: var(--clearance-high) !important;
    border-color: rgba(251, 146, 60, 0.2) !important;
}

.tag-clearance-critical {
    background: rgba(248, 113, 113, 0.1) !important;
    color: var(--clearance-critical) !important;
    border-color: rgba(248, 113, 113, 0.2) !important;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.15);
}

.tag-clearance-max {
    background: rgba(192, 132, 252, 0.15) !important;
    color: var(--clearance-max) !important;
    border-color: rgba(192, 132, 252, 0.3) !important;
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.25);
    animation: pulse-purple 2s infinite alternate;
}

/* ==========================================================================
   6. Custom CTF / Cybertech Components
   ========================================================================== */

/* --- Terminal Box --- */
.terminal-box {
    background: #04060b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    min-height: 220px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #a7f3d0;
    overflow-x: auto;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warning); }
.dot-green { background: var(--success); }

.terminal-output {
    white-space: pre-wrap;
    line-height: 1.5;
}

.sql-error {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.08);
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(239, 68, 68, 0.25);
    margin-top: 10px;
    font-family: 'Fira Code', monospace;
}

/* --- Flag / CTF Box --- */
.flag-box {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
    border: 2px solid rgba(244, 63, 94, 0.35);
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 32px;
    position: relative;
    text-align: left;
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.1);
    animation: border-glow-animation 4s infinite alternate;
}

.flag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.flag-badge {
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.flag-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #fda4af;
    font-size: 1rem;
}

.flag-container {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(9, 13, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
}

.flag-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.05rem;
    color: #38bdf8;
    font-weight: 600;
    word-break: break-all;
    flex-grow: 1;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* --- Avatar & Profile Details --- */
.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(244, 63, 94, 0.2) 100%);
    border: 2.5px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease;
    overflow: hidden;
}

.avatar:hover {
    transform: scale(1.08) rotate(3deg);
    border-color: var(--primary);
}

.avatar svg {
    width: 55px;
    height: 55px;
    fill: var(--text-main);
    opacity: 0.85;
}

.profile-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Code', monospace;
}

.info-section {
    background: rgba(9, 13, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 24px;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-group:first-child {
    padding-top: 0;
}

.info-group:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-main);
}

.bio-text {
    line-height: 1.6;
    color: #e2e8f0;
    font-style: italic;
}

/* --- Hint Box & Error Message --- */
.hint-box {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.error-message {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid var(--accent);
    color: #fda4af;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    text-align: left;
    animation: shake 0.5s ease-in-out;
}

/* ==========================================================================
   7. Animations
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-purple {
    0% {
        box-shadow: 0 0 12px rgba(192, 132, 252, 0.15);
    }
    100% {
        box-shadow: 0 0 24px rgba(192, 132, 252, 0.45);
    }
}

@keyframes border-glow-animation {
    0% {
        border-color: rgba(244, 63, 94, 0.35);
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.05);
    }
    100% {
        border-color: rgba(99, 102, 241, 0.45);
        box-shadow: 0 0 35px rgba(99, 102, 241, 0.2);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
