/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f3f0;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --border: rgba(99, 102, 241, 0.12);
    --border-hover: rgba(139, 92, 246, 0.3);
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #8a8aaa;
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #7c3aed;
    --accent-4: #6d28d9;
    --cyan: #0891b2;
    --emerald: #059669;
    --rose: #e11d48;
    --amber: #d97706;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: rgba(99, 102, 241, 0.08);
    top: -200px;
    left: -100px;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.06);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: rgba(34, 211, 238, 0.05);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(30px, -30px);
    }

    50% {
        transform: translate(-20px, 20px);
    }

    75% {
        transform: translate(20px, 30px);
    }
}

/* ===== TOPBAR ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 243, 240, 0.8);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topbar-left {
    flex-shrink: 0;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    display: flex;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.topbar-center {
    flex: 1;
    max-width: 520px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 0 16px;
    height: 40px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--text-muted);
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-link {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.06);
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 32px 60px;
    display: flex;
    align-items: center;
    gap: 60px;
    min-height: 520px;
}

.hero-content {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--emerald);
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 6px 14px;
    border-radius: 24px;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3), var(--cyan));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 200% center;
    }
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.btn-primary:hover::after {
    transform: translateX(100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.18);
    padding: 13px 24px;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.9);
}

/* Hero Visual */
.hero-visual {
    flex-shrink: 0;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 150px;
    height: 150px;
    border-color: rgba(99, 102, 241, 0.25);
    animation: spin 20s linear infinite;
}

.orbit-2 {
    width: 220px;
    height: 220px;
    border-color: rgba(139, 92, 246, 0.15);
    animation: spin 30s linear infinite reverse;
}

.orbit-3 {
    width: 290px;
    height: 290px;
    border-color: rgba(167, 139, 250, 0.08);
    animation: spin 40s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.center-hex {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.orbit-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 12px var(--accent-1);
}

.dot-1 {
    top: 50%;
    left: 3%;
    animation: orbitmove1 20s linear infinite;
}

.dot-2 {
    top: 15%;
    left: 50%;
    animation: orbitmove2 30s linear infinite;
}

.dot-3 {
    top: 85%;
    left: 50%;
    animation: orbitmove3 25s linear infinite;
}

.dot-4 {
    top: 50%;
    right: 3%;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
    animation: orbitmove4 35s linear infinite;
}

.dot-5 {
    top: 30%;
    left: 20%;
    width: 5px;
    height: 5px;
    background: var(--emerald);
    box-shadow: 0 0 10px var(--emerald);
    animation: orbitmove5 22s linear infinite;
}

@keyframes orbitmove1 {
    0% {
        top: 50%;
        left: 3%;
    }

    25% {
        top: 15%;
        left: 50%;
    }

    50% {
        top: 50%;
        left: 97%;
    }

    75% {
        top: 85%;
        left: 50%;
    }

    100% {
        top: 50%;
        left: 3%;
    }
}

@keyframes orbitmove2 {
    0% {
        top: 15%;
        left: 50%;
    }

    25% {
        top: 50%;
        left: 97%;
    }

    50% {
        top: 85%;
        left: 50%;
    }

    75% {
        top: 50%;
        left: 3%;
    }

    100% {
        top: 15%;
        left: 50%;
    }
}

@keyframes orbitmove3 {
    0% {
        top: 85%;
        left: 50%;
    }

    25% {
        top: 50%;
        left: 3%;
    }

    50% {
        top: 15%;
        left: 50%;
    }

    75% {
        top: 50%;
        left: 97%;
    }

    100% {
        top: 85%;
        left: 50%;
    }
}

@keyframes orbitmove4 {
    0% {
        top: 50%;
        right: 3%;
    }

    33% {
        top: 20%;
        right: 40%;
    }

    66% {
        top: 70%;
        right: 80%;
    }

    100% {
        top: 50%;
        right: 3%;
    }
}

@keyframes orbitmove5 {
    0% {
        top: 30%;
        left: 20%;
    }

    33% {
        top: 70%;
        left: 60%;
    }

    66% {
        top: 20%;
        left: 80%;
    }

    100% {
        top: 30%;
        left: 20%;
    }
}

/* ===== QUICK FILTER ===== */
.quick-filter {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px 40px;
}

.filter-inner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.1);
    padding: 7px 16px;
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(139, 92, 246, 0.08);
}

.filter-chip.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    font-weight: 500;
}

/* ===== SECTIONS ===== */
.communities,
.recent,
.browse {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px 60px;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.section-title svg {
    color: var(--accent-3);
}

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.view-all {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-3);
    transition: var(--transition);
}

.view-all:hover {
    color: var(--accent-4);
}

/* ===== COMMUNITY CARDS ===== */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.community-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
}

.community-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-1), var(--accent-3), transparent);
    opacity: 0;
    transition: var(--transition);
}

.community-card:hover .card-glow {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon.medicina {
    background: rgba(244, 63, 94, 0.12);
    color: var(--rose);
}

.card-icon.posgrados {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-1);
}

.card-icon.empresariales {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber);
}

.card-icon.juridicas {
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
}

.card-icon.sociales {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-2);
}

.card-icon.odontologia {
    background: rgba(52, 211, 153, 0.12);
    color: var(--emerald);
}

.card-icon.ingenieria {
    background: rgba(167, 139, 250, 0.12);
    color: var(--accent-3);
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.card-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.community-card:hover .card-arrow {
    color: var(--accent-3);
    transform: translateX(4px);
}

/* ===== THESIS CARDS ===== */
.thesis-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.thesis-card {
    position: relative;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.thesis-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.thesis-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 14px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tag-sociales {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-3);
}

.tag-medicina {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.thesis-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thesis-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thesis-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.thesis-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-3);
    transition: var(--transition);
}

.thesis-link:hover {
    color: var(--accent-4);
}

/* ===== BROWSE SECTION ===== */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.browse-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.browse-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.browse-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    color: var(--accent-3);
    transition: var(--transition);
}

.browse-card:hover .browse-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    transform: scale(1.05);
}

.browse-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.browse-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: rgba(245, 243, 240, 0.85);
    backdrop-filter: blur(20px);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 32px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand .logo-group {
    margin-bottom: 12px;
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
}

.logo-icon.small svg {
    width: 24px;
    height: 24px;
}

.footer-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.footer-links a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-3);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 32px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 60px 24px 40px;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        width: 250px;
        height: 250px;
    }

    .orbit-container {
        width: 220px;
        height: 220px;
    }

    .browse-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-right .nav-link {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 38px;
    }

    .hero-stats {
        flex-wrap: wrap;
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    .thesis-list {
        grid-template-columns: 1fr;
    }

    .browse-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-center {
        display: none;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 30px;
    }

    .hero-visual {
        display: none;
    }

    .browse-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f0eeeb;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: #1a1a2e;
}

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeUp 0.8s ease-out;
}

.hero-visual {
    animation: fadeUp 1s ease-out 0.2s both;
}

.quick-filter {
    animation: fadeUp 0.8s ease-out 0.4s both;
}

.community-card {
    animation: fadeUp 0.6s ease-out both;
}

.community-card:nth-child(1) {
    animation-delay: 0.1s;
}

.community-card:nth-child(2) {
    animation-delay: 0.15s;
}

.community-card:nth-child(3) {
    animation-delay: 0.2s;
}

.community-card:nth-child(4) {
    animation-delay: 0.25s;
}

.community-card:nth-child(5) {
    animation-delay: 0.3s;
}

.community-card:nth-child(6) {
    animation-delay: 0.35s;
}

.community-card:nth-child(7) {
    animation-delay: 0.4s;
}

.thesis-card {
    animation: fadeUp 0.6s ease-out both;
}

.thesis-card:nth-child(1) {
    animation-delay: 0.1s;
}

.thesis-card:nth-child(2) {
    animation-delay: 0.15s;
}

.thesis-card:nth-child(3) {
    animation-delay: 0.2s;
}

.thesis-card:nth-child(4) {
    animation-delay: 0.25s;
}

.thesis-card:nth-child(5) {
    animation-delay: 0.3s;
}

.thesis-card:nth-child(6) {
    animation-delay: 0.35s;
}

/* ===== APP TRANSITION ===== */
#app {
    transition: opacity 0.15s ease;
}

/* ===== SEARCH DROPDOWN ===== */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 200;
}

.search-dropdown.active {
    display: block;
}

.search-box {
    position: relative;
}

.sd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sd-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.sd-tag {
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sd-info {
    flex: 1;
    min-width: 0;
}

.sd-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.sd-info mark {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-1);
    border-radius: 2px;
    padding: 0 2px;
}

.sd-viewall {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-1);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.sd-viewall:hover {
    background: rgba(99, 102, 241, 0.04);
}

.sd-empty {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 32px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}

.bc-link {
    color: var(--accent-1);
    transition: var(--transition);
}

.bc-link:hover {
    color: var(--accent-4);
}

.bc-sep {
    color: var(--text-muted);
}

.bc-current {
    color: var(--text-secondary);
}

/* ===== PAGE SECTIONS ===== */
.page-section {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 32px 60px;
}

.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.page-title svg {
    color: var(--accent-1);
}

.page-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.page-desc strong {
    color: var(--text-primary);
}

.sub-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.accent-link {
    color: var(--accent-1);
    font-weight: 500;
}

.accent-link:hover {
    color: var(--accent-4);
}

/* ===== COMMUNITY CARD LG ===== */
.community-card-lg {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 16px;
    text-decoration: none;
}

.community-card-lg:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.community-card-lg .card-body {
    flex: 1;
}

.community-card-lg h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.community-card-lg p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.community-card-lg .card-arrow {
    font-size: 22px;
    color: var(--text-muted);
    margin-top: 4px;
    transition: var(--transition);
}

.community-card-lg:hover .card-arrow {
    color: var(--accent-1);
    transform: translateX(4px);
}

.card-stats-row {
    display: flex;
    gap: 16px;
}

.mini-stat {
    font-size: 12px;
    color: var(--text-muted);
}

.mini-stat strong {
    color: var(--accent-1);
    font-family: 'JetBrains Mono', monospace;
}

/* ===== COMMUNITY HERO ===== */
.community-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.comm-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comm-hero-icon svg {
    width: 36px;
    height: 36px;
}

.comm-hero-info {
    flex: 1;
}

.comm-hero-info .page-title {
    margin-bottom: 4px;
}

.comm-hero-stats {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.mini-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-1);
}

/* ===== COLLECTIONS ===== */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.collection-card {
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.collection-card:hover {
    border-color: var(--border-hover);
}

.collection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.collection-info h3 {
    font-size: 14px;
    font-weight: 600;
}

.collection-bar {
    height: 4px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.collection-bar .bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

/* ===== THESIS DETAIL ===== */
.thesis-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.thesis-main {
    min-width: 0;
}

.thesis-detail-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 16px 0 20px;
}

.thesis-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.06);
    color: var(--accent-1);
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.detail-section {
    margin-bottom: 36px;
}

.detail-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.thesis-abstract {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.06);
    color: var(--accent-2);
    border: 1px solid rgba(139, 92, 246, 0.12);
    transition: var(--transition);
    cursor: default;
}

.keyword-chip:hover {
    background: rgba(139, 92, 246, 0.12);
}

/* Related */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.related-card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card .card-arrow {
    font-size: 16px;
    color: var(--text-muted);
}

.thesis-tag.small {
    font-size: 9px;
    padding: 2px 8px;
}

/* Sidebar */
.thesis-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.sidebar-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.sb-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sb-value {
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    color: var(--text-primary);
}

.sb-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.sidebar-community {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.04);
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.sidebar-community:hover {
    background: rgba(99, 102, 241, 0.08);
}

.sidebar-community .card-icon.small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-community .card-icon.small svg {
    width: 18px;
    height: 18px;
}

.full-width {
    width: 100%;
    justify-content: center;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary.full-width {
    margin-top: 0;
}

/* ===== LOGIN ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    color: var(--accent-1);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--accent-1);
}

.forgot-link {
    color: var(--accent-1);
    font-weight: 500;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin-fast 0.6s linear infinite;
}

@keyframes spin-fast {
    to {
        transform: rotate(360deg);
    }
}

/* ===== STATS ===== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-overview-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-overview-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-ov-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    color: var(--accent-1);
    flex-shrink: 0;
}

.stat-ov-info {
    display: flex;
    flex-direction: column;
}

.stat-ov-info .stat-number {
    font-size: 26px;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 24px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 200px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.bar-track .bar-fill {
    width: 100%;
    height: 0;
    background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-1);
    font-family: 'JetBrains Mono', monospace;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.horiz-chart {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.horiz-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.horiz-label {
    font-size: 12px;
    color: var(--text-secondary);
    width: 110px;
    text-align: right;
    flex-shrink: 0;
}

.horiz-track {
    flex: 1;
    height: 20px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.horiz-track .bar-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.horiz-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    width: 36px;
}

.keywords-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.cloud-tag {
    color: var(--accent-2);
    font-weight: 600;
    transition: var(--transition);
    cursor: default;
}

.cloud-tag:hover {
    color: var(--accent-1);
    transform: scale(1.1);
}

.cloud-tag sup {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ===== BROWSE ===== */
.browse-tabs {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
}

.browse-tab {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.browse-tab:hover {
    color: var(--text-primary);
}

.browse-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.browse-results {
    margin-top: 32px;
}

.browse-group {
    margin-bottom: 28px;
}

.group-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.06);
    padding: 2px 10px;
    border-radius: 10px;
}

.group-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.browse-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.browse-item:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.browse-item-content {
    flex: 1;
    min-width: 0;
}

.browse-item-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.browse-item-content .meta-item {
    font-size: 11px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.06);
    color: var(--accent-1);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px 16px;
    border-top: 1px solid var(--border);
}

.mobile-menu.active {
    display: flex;
}

/* ===== TAG COLORS FOR NEW TAGS ===== */
.tag-empresariales {
    background: rgba(217, 119, 6, 0.12);
    color: var(--amber);
}

.tag-juridicas {
    background: rgba(8, 145, 178, 0.12);
    color: var(--cyan);
}

.tag-ingenieria {
    background: rgba(124, 58, 237, 0.12);
    color: var(--accent-3);
}

.tag-odontologia {
    background: rgba(5, 150, 105, 0.12);
    color: var(--emerald);
}

.tag-posgrados {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-1);
}

/* ===== RESPONSIVE ADDITIONS ===== */
@media (max-width: 1024px) {
    .thesis-detail-grid {
        grid-template-columns: 1fr;
    }

    .thesis-sidebar {
        order: -1;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .community-hero {
        flex-direction: column;
        text-align: center;
    }

    .comm-hero-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .topbar-right {
        display: none;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    .thesis-detail-title {
        font-size: 22px;
    }

    .breadcrumb {
        font-size: 11px;
        padding: 12px 16px 0;
    }

    .page-section {
        padding: 24px 16px 40px;
    }

    .collections-grid {
        grid-template-columns: 1fr;
    }

    .browse-tabs {
        flex-wrap: wrap;
    }
}
.stat-card { cursor: pointer; text-decoration: none; color: inherit; transition: transform 0.3s ease; }
.stat-card:hover { transform: translateY(-5px); }
