/* ==========================================================================
   ALPHA - SISTEMA DE DISEÑO Y ESTILOS PRINCIPALES
   Colores Corporativos: Azul Real (#0055b8), Verde Lima (#c8d400), Blanco (#ffffff)
   ========================================================================== */

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

:root {
    --alpha-blue: #0055b8;
    --alpha-blue-dark: #003e87;
    --alpha-blue-deep: #08214d;
    --alpha-blue-light: #eaf2fc;
    --alpha-blue-subtle: #f1f6fd;
    --alpha-lime: #c8d400;
    --alpha-lime-dark: #9ca600;
    --alpha-lime-light: #f5f8b8;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #ffffff;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-subtle: 0 2px 8px rgba(0, 85, 184, 0.04);
    --shadow-card: 0 10px 25px -5px rgba(0, 30, 80, 0.08), 0 8px 10px -6px rgba(0, 30, 80, 0.04);
    --shadow-hover: 0 20px 35px -10px rgba(0, 85, 184, 0.22), 0 10px 15px -8px rgba(0, 85, 184, 0.15);
    --shadow-glow: 0 0 25px rgba(200, 212, 0, 0.45);

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   TIPOGRAFÍA Y ENCABEZADOS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--alpha-blue-deep);
    line-height: 1.25;
}

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

a:hover {
    color: var(--alpha-blue-dark);
}

/* ==========================================================================
   CABECERA Y NAVBAR
   ========================================================================== */
.site-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.03);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--alpha-blue);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--alpha-blue);
    background-color: var(--alpha-blue-light);
}

.btn-admin {
    background: linear-gradient(135deg, var(--alpha-blue), var(--alpha-blue-dark));
    color: #ffffff !important;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 85, 184, 0.25);
    transition: var(--transition);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 85, 184, 0.35);
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #051d45 0%, #0055b8 65%, #004599 100%);
    color: #ffffff;
    padding: 3.5rem 1.5rem 4rem;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: radial-gradient(#ffffff 2px, transparent 2px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-decor-shape {
    position: absolute;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(200, 212, 0, 0.25) 0%, rgba(200, 212, 0, 0) 70%);
    top: -120px;
    right: -100px;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.hero-container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: var(--alpha-lime);
    padding: 0.4rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background-color: var(--alpha-lime);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--alpha-lime);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    color: #ffffff;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-title span {
    color: var(--alpha-lime);
    position: relative;
    display: inline-block;
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.88);
    max-width: 680px;
    margin: 0 auto 2.2rem;
    line-height: 1.6;
}

/* Buscador y Filtros en Hero */
.search-box-wrapper {
    max-width: 620px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-full);
    padding: 0.4rem 0.5rem 0.4rem 1.4rem;
    box-shadow: 0 12px 30px rgba(0, 20, 60, 0.25);
}

.search-box svg {
    color: var(--alpha-blue);
    flex-shrink: 0;
}

.search-input {
    border: none;
    outline: none;
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-primary);
}

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

.search-btn {
    background: var(--alpha-lime);
    color: var(--alpha-blue-deep);
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-btn:hover {
    background: #b5c200;
    transform: scale(1.02);
}

/* ==========================================================================
   SECCIÓN DE FILTROS
   ========================================================================== */
.catalog-controls {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-subtle);
}

.controls-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.filter-btn {
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-secondary);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-btn:hover {
    border-color: var(--alpha-blue);
    color: var(--alpha-blue);
    background-color: var(--alpha-blue-light);
}

.filter-btn.active {
    background: var(--alpha-blue);
    border-color: var(--alpha-blue);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 85, 184, 0.25);
}

.sort-select {
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
}

/* ==========================================================================
   GRILLA DE CATÁLOGOS
   ========================================================================== */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    width: 100%;
    flex: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2rem;
    color: var(--alpha-blue-deep);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Tarjeta de Catálogo */
.catalog-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}

.catalog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 85, 184, 0.3);
}

.card-cover-wrapper {
    position: relative;
    width: 100%;
    padding-top: 135%; /* Ratio revista ~ 1:1.35 */
    background: #e2e8f0;
    overflow: hidden;
}

.card-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.catalog-card:hover .card-cover-img {
    transform: scale(1.04);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--alpha-lime);
    color: var(--alpha-blue-deep);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.card-badge.featured {
    background: var(--alpha-blue);
    color: #ffffff;
}

.card-overlay-actions {
    position: absolute;
    inset: 0;
    background: rgba(8, 33, 77, 0.75);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 1.5rem;
    z-index: 3;
}

.catalog-card:hover .card-overlay-actions {
    opacity: 1;
}

.btn-open-reader {
    background: var(--alpha-lime);
    color: var(--alpha-blue-deep) !important;
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(10px);
    transition: transform 0.25s ease, background 0.2s ease;
}

.catalog-card:hover .btn-open-reader {
    transform: translateY(0);
}

.btn-open-reader:hover {
    background: #ffffff;
}

.btn-quick-download {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transform: translateY(10px);
    transition: transform 0.25s ease 0.05s, background 0.2s ease;
}

.catalog-card:hover .btn-quick-download {
    transform: translateY(0);
}

.btn-quick-download:hover {
    background: rgba(255, 255, 255, 0.35);
}

.card-body {
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-category {
    color: var(--alpha-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.35;
    font-weight: 700;
}

.card-title a {
    color: inherit;
}

.card-title a:hover {
    color: var(--alpha-blue);
}

.card-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Estado Vacío */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    grid-column: 1 / -1;
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
.site-footer {
    background: var(--alpha-blue-deep);
    color: #ffffff;
    margin-top: auto;
    padding: 3rem 1.5rem 1.5rem;
    border-top: 4px solid var(--alpha-lime);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    max-width: 400px;
    line-height: 1.6;
}

.footer-col h4 {
    color: var(--alpha-lime);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: var(--alpha-lime);
    transform: translateX(4px);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================================================
   BOTONES Y COMPONENTES GLOBALES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--alpha-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--alpha-blue-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 85, 184, 0.3);
}

.btn-lime {
    background: var(--alpha-lime);
    color: var(--alpha-blue-deep);
}

.btn-lime:hover {
    background: #b5c200;
    color: var(--alpha-blue-deep);
}

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

.btn-outline:hover {
    border-color: var(--alpha-blue);
    color: var(--alpha-blue);
    background: var(--alpha-blue-light);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Alertas */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-info {
    background: var(--alpha-blue-light);
    color: var(--alpha-blue-dark);
    border-left: 4px solid var(--alpha-blue);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 0.75rem 1rem;
    }
    .brand-title {
        font-size: 1.05rem;
    }
    .brand-subtitle {
        display: none;
    }
    .hero-section {
        padding: 2.5rem 1rem 3rem;
    }
    .hero-title {
        font-size: 1.85rem;
    }
    .hero-description {
        font-size: 0.95rem;
    }
    .search-box {
        padding: 0.25rem 0.25rem 0.25rem 1rem;
    }
    .search-btn {
        padding: 0.6rem 1.1rem;
        font-size: 0.88rem;
    }
    .catalog-grid {
        grid-template-columns: 1fr;
    }
}
