:root {
    --primary-blue: #005EB8;
    --primary-blue-light: #0080C8;
    --accent-gold: #FFD700;
    --accent-red: #E30613;
    --dark-bg: #001F3F;
    --dark-secondary: #000814;
    --text-light: #f8f9fa;
    --text-muted: #6c757d;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-bg) 100%);
    box-shadow: 0 2px 20px rgba(0, 94, 184, 0.3);
}

.text-accent {
    color: var(--accent-gold) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #004494 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 94, 184, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #004494 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 94, 184, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #e6c200 100%);
    border: none;
    color: var(--dark-bg);
    padding: 0.75rem 2rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #e6c200 0%, var(--accent-gold) 100%);
    color: var(--dark-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-bg) 50%, var(--dark-secondary) 100%);
    padding: 120px 0 80px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100"><polygon fill="rgba(255,215,0,0.1)" points="0,0 1000,0 1000,60 0,100"/></svg>') no-repeat bottom;
    background-size: 100% 100px;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.section-title {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    border-radius: 2px;
}

.gallery-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 94, 184, 0.2);
}

.gallery-card img,
.gallery-card video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card:hover img,
.gallery-card:hover video {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 31, 63, 0.9));
    padding: 2rem 1rem 1rem;
    color: white;
}

.admin-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.admin-card:hover {
    box-shadow: 0 10px 30px rgba(0, 94, 184, 0.15);
}

.stat-card {
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 94, 184, 0.15);
}

.upload-zone {
    border: 2px dashed var(--primary-blue);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 94, 184, 0.05) 0%, rgba(255, 215, 0, 0.05) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(0, 94, 184, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    transform: scale(1.02);
}

.media-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.media-item:hover {
    box-shadow: 0 10px 25px rgba(0, 94, 184, 0.2);
}

.media-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.media-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
}

.footer {
    background: linear-gradient(135deg, var(--dark-secondary) 0%, var(--dark-bg) 100%);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Home redesign */
.hero-section {
    padding: clamp(96px, 12vw, 140px) 0 clamp(72px, 10vw, 104px);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-layer {
    position: absolute;
    inset: -10% -10%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.96);
    opacity: 0;
    animation: hero-sweep 18s ease-in-out infinite;
}

.hero-bg-layer-1 {
    background-image: url('../img/hero-1.jpg');
    animation-delay: 0s;
}

.hero-bg-layer-2 {
    background-image: url('../img/hero-2.jpg');
    animation-delay: 6s;
}

.hero-bg-layer-3 {
    background-image: url('../img/hero-3.jpg');
    animation-delay: 12s;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 16, 48, 0.62) 0%, rgba(0, 16, 48, 0.38) 58%, rgba(0, 8, 24, 0.64) 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(900px 420px at 12% 18%, rgba(255, 215, 0, 0.1) 0%, transparent 64%);
    pointer-events: none;
}

@keyframes hero-sweep {
    0% {
        opacity: 0;
        transform: scale(1.08) translateX(-2%);
    }
    10% {
        opacity: 1;
    }
    30% {
        opacity: 1;
        transform: scale(1.02) translateX(1%);
    }
    40% {
        opacity: 0;
    }
    100% {
        opacity: 0;
        transform: scale(1.08) translateX(-2%);
    }
}

.hero-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 90px;
    background: linear-gradient(180deg, transparent 0%, #f8f9fa 100%);
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-inner {
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 760px;
    text-align: center;
    margin: 0 auto;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
}

.hero-title {
    margin: 1.2rem 0 0.8rem;
    font-weight: 800;
    font-size: clamp(2.6rem, 9vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
}

.hero-date {
    margin: 0;
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-subtitle {
    margin: 1rem auto 0;
    max-width: 620px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
    margin-top: clamp(1.8rem, 6vw, 2.8rem);
}

.btn-outline-light {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-width: 1px;
}

.stats-section {
    margin-top: -60px;
    position: relative;
    z-index: 3;
    padding-bottom: clamp(2rem, 6vw, 3.5rem);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(1rem, 4vw, 1.6rem);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 30px 60px -30px rgba(0, 31, 63, 0.4);
    padding: clamp(1.2rem, 4vw, 1.8rem);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 40px 70px -30px rgba(0, 94, 184, 0.35);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 94, 184, 0.16) 0%, rgba(0, 94, 184, 0.08) 100%);
    color: var(--primary-blue);
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-number {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-weight: 500;
}

.recent-section {
    padding: clamp(1rem, 6vw, 3rem) 0 clamp(4rem, 10vw, 6rem);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: clamp(1.8rem, 6vw, 2.8rem);
}

.section-title {
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 2.8rem);
    margin-bottom: 0.4rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 72px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
}

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-blue);
}

.section-link:hover {
    color: #004494;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(0.8rem, 3vw, 1.2rem);
}

.recent-card {
    grid-column: span 12;
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -25px rgba(0, 31, 63, 0.45);
    aspect-ratio: 4 / 3;
    text-decoration: none;
}

.recent-card img,
.recent-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.recent-card:hover img,
.recent-card:hover video {
    transform: scale(1.05);
}

.recent-card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 8, 20, 0.8) 100%);
}

.recent-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (min-width: 576px) {
    .recent-card {
        grid-column: span 6;
    }
}

@media (min-width: 992px) {
    .recent-card {
        grid-column: span 3;
    }
    .hero-copy {
        text-align: left;
        margin: 0;
    }
    .hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 575px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .stats-section {
        margin-top: -36px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.6rem;
        padding: 0.9rem 0.7rem;
    }
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    .stat-number {
        font-size: 1.8rem;
    }
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Fixed header/footer layout */
html, body {
    height: 100%;
}

.app-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    flex: 0 0 auto;
}

.app-main {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-main::-webkit-scrollbar {
    display: none;
}

.app-footer {
    flex: 0 0 auto;
    position: relative;
    z-index: 1020;
}

@media (max-width: 575px) {
    .app-footer {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }
    .app-footer small {
        font-size: 0.7rem;
    }
}

/* Admin compact stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.admin-stat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    padding: 0.6rem 0.8rem;
}

.admin-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1;
}

.admin-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.1;
}

.admin-stat-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.1;
    margin-top: 0.1rem;
}

.admin-stat.is-analytics {
    grid-column: span 2;
}

@media (max-width: 576px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .admin-stat {
        padding: 0.5rem 0.6rem;
    }
    .admin-stat-value {
        font-size: 1rem;
    }
    .admin-stat.is-analytics {
        grid-column: span 1;
    }
    .upload-zone {
        display: none;
    }
}

/* Admin actions wrap */
.admin-actions {
    gap: 0.3rem !important;
}

.admin-actions .btn {
    padding: 0.25rem 0.45rem;
}

/* Estado sobre la miniatura: solo en móvil, donde la columna Estado se oculta */
.admin-thumb-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.admin-thumb-status {
    display: none;
}

@media (max-width: 767.98px) {
    .admin-thumb-status {
        display: flex;
        position: absolute;
        right: -4px;
        bottom: -4px;
        width: 20px;
        height: 20px;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
        border-radius: 50%;
        color: #fff;
        font-size: 0.6rem;
        line-height: 1;
        pointer-events: none;
    }
    .admin-thumb-status.is-on {
        background: #198754;
    }
    .admin-thumb-status.is-off {
        background: #6c757d;
    }
}

/* Tabla de medios: el contenedor es el único scroller y el encabezado es sticky dentro de él */
.admin-table-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.admin-table-wrap {
    max-height: 420px;
    max-height: min(420px, 60vh);
    overflow: auto;
    overscroll-behavior: contain;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

@media (max-width: 576px) {
    .admin-table th,
    .admin-table td {
        padding: 0.45rem 0.25rem;
    }
    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 34px !important;
        padding-left: 0.5rem;
    }
    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2) {
        width: 56px !important;
    }
    .admin-table td:nth-child(2) .admin-thumb {
        width: 48px !important;
        height: 48px !important;
    }
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        text-align: center;
    }
    .admin-table td:nth-child(3) form {
        justify-content: center;
    }
    .admin-table td:nth-child(3) .form-select {
        width: auto;
        max-width: 150px;
        padding-left: 0.4rem;
        padding-right: 1.75rem;
        font-size: 0.75rem;
    }
    .admin-actions {
        min-width: 80px;
    }
    .admin-actions-wrap {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem !important;
        justify-items: center;
    }
    .admin-actions-wrap .btn,
    .admin-actions-wrap form {
        width: 100%;
    }
}
