/* 
   Insp3ct Modern Design System 
   Theme: Cyber-Glass / Dark Mode
*/

:root {
    --bg-dark: #050507;
    --bg-card: rgba(22, 27, 34, 0.7);
    --bg-card-hover: rgba(30, 36, 46, 0.8);

    --primary: #00ff9d;
    /* Neon Green */
    --primary-dim: rgba(0, 255, 157, 0.1);
    --secondary: #00f0ff;
    /* Cyber Blue */
    --accent: #7000ff;
    /* Deep Purple */
    --error: #ff4757;
    --warning: #ffa502;
    --success: #2ed573;

    --text-main: #ffffff;
    --text-muted: #a0a0b0;

    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur: blur(12px);

    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.08), transparent 25%);
    filter: contrast(120%);
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #fff, var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    height: 80px;
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: var(--blur);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand .logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    filter: drop-shadow(0 0 5px var(--primary-dim));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-item {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-item:hover {
    color: var(--primary);
}

.icon {
    margin-right: 6px;
}

/* Buttons & Inputs */
.btn,
button,
.nav-item.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary,
button {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-dim);
}

.btn-primary:hover,
button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
}

.btn-logout {
    color: var(--error) !important;
}

.btn-logout:hover {
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-ui);
    transition: 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Main Layout */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeInUp 0.6s ease-out;
}

.container {
    max-width: 800px;
    /* Legacy support */
    margin: 0 auto;
}

/* Tool Grid (Dashboard) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.tool-card {
    background: var(--bg-card);
    border: var(--glass-border);
    backdrop-filter: var(--blur);
    padding: 24px;
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card h3 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.tool-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

.tool-card .btn {
    margin-top: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.tool-card .btn:hover {
    background: var(--primary);
    color: #000;
}

/* Landing Page (Index) */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.feature-list {
    text-align: left;
    display: inline-block;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    border: var(--glass-border);
    margin: 20px 0;
}

.feature-list li {
    list-style: none;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.feature-list li::before {
    content: '✓';
    color: var(--primary);
    font-weight: bold;
    margin-right: 12px;
}

/* Carousel */
.carousel-wrapper {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    margin-top: 60px;
    text-align: center;
}

.carousel-img {
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.carousel-controls button {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* Footer */
.footer {
    border-top: var(--glass-border);
    background: rgba(5, 5, 7, 0.9);
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contributors {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.contrib-avatars img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    margin-left: -10px;
    transition: transform 0.2s;
}

.contrib-avatars img:first-child {
    margin-left: 0;
}

.contrib-avatars img:hover {
    transform: scale(1.2);
    z-index: 10;
    border-color: var(--primary);
}

/* Scan Results & Tables */
.scan-result-text,
.terminal-view {
    font-family: var(--font-mono);
    background: #000;
    color: var(--primary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    overflow-x: auto;
    margin-top: 20px;
    font-size: 0.9rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.alert {
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 165, 2, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
    margin: 20px 0;
    font-weight: 600;
}

/* Utility Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .nav-links span:not(.icon) {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    min-width: 400px;
    background-color: var(--bg-card);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

table thead tr {
    background-color: var(--primary);
    color: #000;
    text-align: left;
    font-weight: bold;
}

table th,
table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table tbody tr:nth-of-type(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary);
}

table tbody tr:hover {
    background-color: rgba(0, 255, 157, 0.05);
    color: var(--primary);
}

/* Score Utility Classes (Compatibility with web.py) */
.score-green {
    color: var(--success) !important;
}

.score-lightgreen {
    color: #64dd17 !important;
}

.score-orange {
    color: var(--warning) !important;
}

.score-red {
    color: var(--error) !important;
}

.score-darkred {
    color: #d32f2f !important;
}

.score-display {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Text Utility Classes */
.text-success {
    color: var(--success) !important;
}

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

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