/* ============================================
   ESCUDO v4.0 — Cyber Dark Theme
   AsesoriaProtech Flagship Security Dashboard
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-base: #0a0a0a;
    --bg-panel: #1a1a2e;
    --bg-accent: #16213e;
    --bg-surface: #0f0f23;
    --primary: #00d4ff;
    --primary-dim: rgba(0, 212, 255, 0.15);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --safe: #10b981;
    --safe-dim: rgba(16, 185, 129, 0.15);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
    --border-hover: #334155;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.1);
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #33ddff;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 3rem 0;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

main {
    flex: 1;
}

/* --- Navigation --- */
.nav {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 46, 0.95);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-brand:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--primary-dim);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-dim);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    background: linear-gradient(180deg, var(--bg-accent) 0%, var(--bg-base) 100%);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero .email-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Cards --- */
.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card .number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.danger {
    border-color: rgba(220, 38, 38, 0.3);
    background: linear-gradient(135deg, var(--bg-panel), var(--danger-dim));
}

.stat-card.danger .number {
    color: var(--danger);
}

.stat-card.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, var(--bg-panel), var(--warning-dim));
}

.stat-card.warning .number {
    color: var(--warning);
}

.stat-card.safe {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--bg-panel), var(--safe-dim));
}

.stat-card.safe .number {
    color: var(--safe);
}

/* --- Threat Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-seguro {
    background: var(--safe-dim);
    color: var(--safe);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sospechoso {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-peligroso {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

/* --- Risk Bar --- */
.risk-bar {
    display: flex;
    gap: 3px;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
    padding: 2px;
}

.risk-bar .segment {
    flex: 1;
    background: var(--border);
    border-radius: 2px;
    transition: background var(--transition);
}

.risk-bar .segment.active {
    animation: pulse 2s ease-in-out infinite;
}

.risk-bar .segment.active.safe { background: var(--safe); }
.risk-bar .segment.active.warning { background: var(--warning); }
.risk-bar .segment.active.danger { background: var(--danger); }

/* --- Tables --- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--bg-accent);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table tr:hover td {
    background: var(--primary-dim);
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.form-button:hover {
    background: #33ddff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-accent);
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #33ddff;
    border-color: #33ddff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* --- URL/Phone Analyzer --- */
.analyzer-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 1.5rem 0;
}

.analyzer-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-base);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    transition: all var(--transition);
}

.analyzer-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim), var(--shadow-glow);
}

.analyzer-input::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

.analyzer-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary), #0099cc);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition);
    margin-top: 1rem;
}

.analyzer-btn:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.analyzer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.analyzer-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: fadeInUp 0.3s ease;
}

/* --- Steps / How-to --- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.step {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

.step:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Education / Tips --- */
.tip-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.tip-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.tip-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dim);
    border-radius: var(--radius);
    font-size: 1.25rem;
}

/* --- Footer --- */
.footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

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

.footer a {
    color: var(--primary);
}

.footer a:hover {
    text-decoration: underline;
}

/* --- Admin Specific --- */
.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.admin-nav .nav-link {
    font-size: 0.85rem;
}

.sidebar {
    width: 260px;
    min-height: calc(100vh - 60px);
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: fadeInUp 0.3s ease both;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--bg-base);
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-safe { color: var(--safe); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Responsive: Tablet (768px) --- */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .split {
        flex-direction: column;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

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

    .analyzer-section {
        padding: 1.25rem;
    }
}

/* --- Responsive: Mobile (480px) --- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .nav .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }

    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .stat-card .number {
        font-size: 1.75rem;
    }

    .analyzer-input {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }

    .analyzer-btn {
        width: 100%;
        padding: 0.85rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.6rem;
    }

    .admin-nav {
        gap: 0.25rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }
}
