/**
 * CVEDNA Theme Main Stylesheet
 * Works with Tailwind CSS 4.1.18 loaded via Play CDN in header
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@400;500;700;900&display=swap');

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

:root {
    --color-red-primary: #dc143c;
    --color-red-dark: #8b0000;
    --color-red-light: #ff3333;
    --color-black-bg: #000000;
    --color-black-dark: #1a1a1a;
    --color-black-medium: #2d2d2d;
    --color-gray: #808080;
    --color-cyber-green: #00ff41;
    --color-cyber-blue: #00d4ff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-black-bg);
    color: #f5f5f5;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-black-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-red-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-red-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--color-red-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-red-light);
}

/* Header */
.site-header {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-red-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-logo img {
    max-height: 32px;
    width: auto;
}

/* Navigation */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-menu li a {
    color: #d1d5db;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: var(--color-red-primary);
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-red-primary);
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after,
.nav-menu li.current-menu-item a::after {
    width: 100%;
}

/* Buttons */
.btn-primary {
    background: var(--color-red-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
    display: inline-block;
}

.btn-primary:hover {
    background: var(--color-red-dark);
    box-shadow: 0 0 40px rgba(220, 20, 60, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-black-medium);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-red-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--color-black-dark);
    border-color: var(--color-red-light);
}

.btn-outline {
    background: transparent;
    color: var(--color-red-primary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--color-red-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-outline:hover {
    background: var(--color-red-primary);
    color: white;
}

/* Cards */
.card {
    background: var(--color-black-dark);
    border: 1px solid var(--color-black-medium);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--color-red-primary);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.2);
}

.card-cve {
    background: var(--color-black-dark);
    border: 1px solid var(--color-black-medium);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card-cve:hover {
    border-color: var(--color-red-primary);
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.4);
    transform: translateY(-4px);
}

/* Severity Badges */
.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.severity-critical {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #991b1b;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.severity-high {
    background: #7c2d12;
    color: #fed7aa;
    border: 1px solid #9a3412;
}

.severity-medium {
    background: #78350f;
    color: #fde68a;
    border: 1px solid #92400e;
}

.severity-low {
    background: #1e3a8a;
    color: #bfdbfe;
    border: 1px solid #1e40af;
}

/* Input Fields */
.input-text {
    width: 100%;
    background: var(--color-black-dark);
    border: 1px solid var(--color-black-medium);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-text::placeholder {
    color: #6b7280;
}

.input-text:focus {
    outline: none;
    border-color: var(--color-red-primary);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #000000, var(--color-black-dark));
    padding: 5rem 0;
}

.cyber-grid {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image:
        linear-gradient(rgba(220, 20, 60, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 20, 60, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 48rem;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    background: var(--color-black-dark);
    border: 1px solid var(--color-black-medium);
    border-radius: 0.5rem;
    padding: 1rem 3rem 1rem 1rem;
    color: white;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-red-primary);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

/* CVE Grid */
.cve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Stats Card */
.stat-card {
    background: linear-gradient(135deg, var(--color-black-dark), var(--color-black-bg));
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(220, 20, 60, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--color-red-primary);
    transform: translateY(-4px);
}

/* Code Block */
.code-block {
    background: #000000;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--color-cyber-green);
    border: 1px solid var(--color-black-medium);
    overflow-x: auto;
}

/* Footer */
.site-footer {
    background: #000000;
    border-top: 1px solid var(--color-red-dark);
    margin-top: 5rem;
    padding: 3rem 0 1rem;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text:hover {
    animation: glitch 0.3s linear infinite;
}

@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); }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--color-red-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Table Styles */
.cve-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.cve-table th {
    background: var(--color-black-dark);
    text-align: left;
    padding: 1rem;
    color: var(--color-red-primary);
    font-weight: 700;
    border-bottom: 2px solid var(--color-red-dark);
}

.cve-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-black-medium);
}

.cve-table tr:hover {
    background: var(--color-black-dark);
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
    margin: 1rem 0;
}

.alert-danger {
    background: rgba(127, 29, 29, 0.2);
    border-color: #991b1b;
    color: #fecaca;
}

.alert-warning {
    background: rgba(120, 53, 15, 0.2);
    border-color: #92400e;
    color: #fde68a;
}

.alert-info {
    background: rgba(30, 58, 138, 0.2);
    border-color: #1e40af;
    color: #bfdbfe;
}

.alert-success {
    background: rgba(20, 83, 45, 0.2);
    border-color: #15803d;
    color: #86efac;
}

/* Utility Classes */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-shadow-glow {
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .cve-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero-section {
        padding: 3rem 0;
    }

    .cve-grid {
        grid-template-columns: 1fr;
    }
}

/* Alpine.js Cloak */
[x-cloak] {
    display: none !important;
}
