/* ═══════════════════════════════════════════════════
   YedaTech Syllabus Audit Manager – Design System
   Basado en el Manual de Marca YedaTech (SKILL.MD)
   ═══════════════════════════════════════════════════ */

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

/* ── Design Tokens ── */
:root {
    /* Brand Colors */
    --primary: #fe6901;
    --primary-light: #ff8a3a;
    --primary-dark: #d95500;
    --secondary: #323333;
    --secondary-light: #454646;
    --accent: #bdbdbd;
    --accent-light: #e0e0e0;

    /* Backgrounds */
    --bg-light: #ffffff;
    --bg-alt: #f5f6f8;
    --bg-dark: #111215;
    --bg-dark-alt: #161719;

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-muted: #9a9ab0;

    /* Functional */
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #2563eb;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #fe6901, #ff8a3a);
    --gradient-btn: linear-gradient(135deg, #fe6901, #d95500);
    --gradient-dark: linear-gradient(135deg, #111215, #1a1a2e);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-brand: 0 4px 20px rgba(254, 105, 1, 0.35);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Nunito Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-alt);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

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

/* ── Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--secondary);
    color: #fff;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.sidebar-logo img {
    max-width: 160px;
    height: auto;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: var(--space-xs);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(254, 105, 1, 0.15);
    color: var(--primary-light);
}

.sidebar-user {
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: var(--accent);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: var(--space-xl) var(--space-2xl);
    min-height: 100vh;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Cards (Glassmorphism) ── */
.card {
    background: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--accent-light);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success { background: rgba(22,163,74,0.1); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-danger  { background: rgba(220,38,38,0.1); color: var(--danger); }
.badge-info    { background: rgba(37,99,235,0.1); color: var(--info); }
.badge-neutral { background: rgba(0,0,0,0.05); color: var(--text-secondary); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(254, 105, 1, 0.5);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(254, 105, 1, 0.08);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-file-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--accent-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(254, 105, 1, 0.15);
}

/* ── File Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    background: rgba(254, 105, 1, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(254, 105, 1, 0.05);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ── Data Grid (Dashboard) ── */
.audit-grid {
    display: grid;
    gap: var(--space-md);
}

.audit-item {
    display: grid;
    grid-template-columns: 1fr 120px 120px 100px;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-light);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.audit-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.audit-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.audit-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Report Cards (Agent Results) ── */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.agent-card {
    background: var(--bg-light);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border-top: 3px solid var(--primary);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.agent-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.05em;
}

.agent-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.agent-detail strong {
    color: var(--text-primary);
}

/* ── RA Section (Report) ── */
.ra-section {
    margin-bottom: var(--space-2xl);
}

.ra-header {
    background: var(--secondary);
    color: var(--primary-light);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
}

.ra-body {
    border: 1px solid rgba(0,0,0,0.06);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: var(--space-lg);
    background: var(--bg-light);
}

/* ── Messages / Alerts ── */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success { background: rgba(22,163,74,0.1); color: var(--success); border-left: 4px solid var(--success); }
.alert-error   { background: rgba(220,38,38,0.1); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(37,99,235,0.1); color: var(--info); border-left: 4px solid var(--info); }

/* ── Hero (Landing) ── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(254, 105, 1, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 138, 58, 0.1) 0%, transparent 40%);
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    padding: var(--space-xl);
}

.hero-content h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: var(--space-md);
}

.hero-content .brand-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* ── Auth Pages ── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.auth-card {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 440px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* Dark body for auth pages with particles */
body.body-dark {
    background: var(--bg-dark);
}

body.body-dark .auth-container {
    background: none;
}

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

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.2s; }
.fade-in-up:nth-child(4) { animation-delay: 0.3s; }
.fade-in-up:nth-child(5) { animation-delay: 0.4s; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }
    .audit-item {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    .agent-grid {
        grid-template-columns: 1fr;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}
