@import url("../../bootstrap/css/bootstrap.min.css");
@import url("../../css/header.css");
@import url("../../css/menu.css");
@import url("../../css/footer.css");
@import url("../../css/socialistas-formulario.css");

:root {
    --videos-rojo: #dd1515;
    --videos-rojo-oscuro: #991116;
    --videos-tinta: #271c1d;
    --videos-texto: #5b4d4d;
    --videos-borde: rgba(146, 24, 24, 0.14);
    --videos-superficie: rgba(255, 255, 255, 0.98);
    --videos-superficie-alt: #fbf6f4;
    --videos-sombra: 0 18px 42px rgba(77, 23, 23, 0.14);
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #fff 52%, #fff 100%) !important;
    color: var(--videos-tinta);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.main-content,
.container {
    width: min(96%, 1320px) !important;
    margin: 0 auto !important;
    padding: 32px 18px 56px !important;
}

.videos-main.videos-admin-main {
    width: min(92vw, 1680px) !important;
    margin: 0 auto !important;
    padding: 28px 20px 52px !important;
}

.header-videos-flex,
.videos-hero.videos-admin-hero,
.videos-admin-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(215, 221, 228, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(31, 41, 51, 0.08);
}

.header-videos-flex,
.videos-hero.videos-admin-hero {
    display: grid !important;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: flex-start;
    margin: 12px auto 22px;
    padding: 28px 30px;
}

.videos-admin-panel {
    padding: 24px !important;
}

.videos-hero-copy {
    flex: 1;
    min-width: 0;
    color: var(--videos-texto) !important;
}

.videos-kicker {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #000 !important;
    font-weight: 700;
}

.videos-description {
    margin: 14px 0 0;
    max-width: 860px;
    font-size: 16px;
    line-height: 1.7;
    color: #000 !important;
}

.page-title,
.content-box h1,
.content-box h2,
.form-container h1 {
    margin: 0 0 20px !important;
    color: var(--videos-tinta) !important;
    font-size: clamp(1.85rem, 2.8vw, 2.35rem) !important;
    line-height: 1.12;
    font-weight: 800 !important;
    text-align: center;
}

.page-title-left {
    text-align: left !important;
    color: #000 !important;
    margin-bottom: 0 !important;
}

.videos-admin-heading-row {
    align-items: center;
}

.videos-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: center;
}

.videos-admin-search {
    justify-self: end;
    width: 100%;
    color: #000 !important;
}

.videos-search-field,
.videos-admin-search-field {
    position: relative;
}

.videos-search-field i,
.videos-admin-search-field i {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #000 !important;
    font-size: 0.95rem;
    pointer-events: none;
}

.videos-search-input,
.videos-admin-search-input {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px 12px 48px !important;
    border-radius: 16px !important;
    border: 1px solid #d7dde4 !important;
    background: #f9fafb !important;
    color: #000 !important;
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.videos-search-input::placeholder,
.videos-admin-search-input::placeholder {
    color: #8a94a6;
}

.videos-search-input:focus,
.videos-admin-search-input:focus {
    border-color: rgba(221, 21, 21, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(221, 21, 21, 0.12) !important;
    background: #fff !important;
}

.videos-search-counter,
.videos-admin-search-counter {
    color: #000 !important;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.btn-volver,
.volver,
.btn-volver-video,
.btn-volver-admin,
.btn-submit,
.btn-cancelar,
.btn-editar,
.btn-eliminar,
.pagination button,
.modal-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px !important;
    padding: 11px 18px !important;
    font-size: 0.97rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-volver,
.volver,
.btn-cancelar {
    background: transparent !important;
    color: #22303c !important;
    border: 1px solid rgba(146, 24, 24, 0.16) !important;
    box-shadow: none !important;
}

.btn-volver-video,
.btn-volver-admin {
    background: transparent !important;
    color: #22303c !important;
    padding: 10px 12px !important;
    margin: -4px 0 0 -6px;
    font-size: 16px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    border: 1px solid rgba(146, 24, 24, 0.16) !important;
    justify-content: flex-start;
}

.btn-submit,
.pagination button.active,
.modal-close {
    background: linear-gradient(135deg, var(--videos-rojo) 0%, var(--videos-rojo-oscuro) 100%) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(221, 21, 21, 0.22) !important;
}

.videos-admin-panel .btn-editar,
.videos-admin-panel .btn-eliminar,
.form-container-admin .btn-cancelar,
.form-container-admin .btn-subir-video {
    background: #f1f1f1 !important;
    color: #2a2a2a !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 22px rgba(60, 60, 60, 0.1) !important;
}

.btn-volver:hover,
.volver:hover,
.btn-volver-video:hover,
.btn-volver-admin:hover,
.btn-submit:hover,
.btn-cancelar:hover,
.btn-editar:hover,
.btn-eliminar:hover,
.pagination button:hover:not(:disabled),
.modal-close:hover {
    transform: translateY(-1px);
}

.btn-volver-video:hover,
.btn-volver-video:focus-visible,
.btn-volver-admin:hover,
.btn-volver-admin:focus-visible {
    background: #dd1515 !important;
    border-color: #dd1515 !important;
    color: #fff !important;
    transform: translateX(-2px);
    outline: none;
    box-shadow: none !important;
}

.btn-volver:hover,
.btn-volver:focus-visible,
.volver:hover,
.volver:focus-visible {
    background: #dd1515!important;
    border-color: #dd1515 !important;
    color: #fff !important;
    outline: none;
    box-shadow: none !important;
}

.videos-admin-panel .btn-editar:hover,
.videos-admin-panel .btn-editar:focus-visible,
.videos-admin-panel .btn-eliminar:hover,
.videos-admin-panel .btn-eliminar:focus-visible,
.form-container-admin .btn-cancelar:hover,
.form-container-admin .btn-cancelar:focus-visible,
.form-container-admin .btn-subir-video:hover,
.form-container-admin .btn-subir-video:focus-visible {
    background: transparent !important;
    color: #000 !important;
    border-color: rgba(0, 0, 0, 0.22) !important;
    box-shadow: none !important;
    outline: none;
}

.content-box,
.form-container,
.modal-content,
.modal-info {
    background: linear-gradient(180deg, var(--videos-superficie) 0%, var(--videos-superficie-alt) 100%) !important;
    border: 1px solid var(--videos-borde) !important;
    border-radius: 22px !important;
    box-shadow: var(--videos-sombra) !important;
}

.content-box,
.form-container,
.modal-info {
    padding: 28px !important;
}

.form-container-admin {
    max-width: 900px;
    margin: 0 auto;
}

.videos-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 22px;
}

.video-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--videos-superficie) 0%, var(--videos-superficie-alt) 100%) !important;
    border: 1px solid var(--videos-borde) !important;
    border-radius: 22px !important;
    overflow: hidden;
    box-shadow: var(--videos-sombra) !important;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(77, 23, 23, 0.18) !important;
}

.video-player,
.video-preview,
.current-video,
.modal-video {
    width: 100%;
    background: #000;
    border-radius: 18px 18px 0 0;
}

.video-preview-container {
    position: relative;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(15, 11, 11, 0.08) 0%, rgba(15, 11, 11, 0.4) 100%);
}

.play-button {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(221, 21, 21, 0.92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(221, 21, 21, 0.24);
}

.video-info {
    padding: 20px !important;
}

.video-titulo,
.modal-titulo {
    color: #1f2933 !important;
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    line-height: 1.25;
}

.video-detalle,
.modal-detalle,
.video-meta,
.modal-meta,
.file-info,
.optional,
.no-videos,
small {
    color: var(--videos-texto) !important;
}

.video-detalle,
.modal-detalle {
    line-height: 1.72 !important;
}

.video-meta,
.modal-meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(146, 24, 24, 0.12);
    font-size: 0.9rem !important;
}

.video-meta span,
.modal-meta span,
.video-meta i,
.modal-meta i {
    color: #000 !important;
}

.video-duracion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--videos-rojo) 0%, var(--videos-rojo-oscuro) 100%);
    color: #fff !important;
    font-weight: 700;
}

.pagination {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px !important;
}

.pagination button {
    min-width: 42px;
}

.videos-nav-btn,
.videos-page-btn {
    border: 1px solid #d7dde4 !important;
    background: #fff !important;
    color: #253443 !important;
    border-radius: 14px !important;
    min-width: 42px;
    height: 42px;
    padding: 0 14px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    box-shadow: none !important;
}

.videos-page-btn:hover,
.videos-nav-btn:hover,
.videos-page-btn:focus-visible,
.videos-nav-btn:focus-visible {
    border-color: rgba(221, 21, 21, 0.35) !important;
    background: rgba(221, 21, 21, 0.1) !important;
    color: #b31515 !important;
    outline: none;
    transform: none !important;
}

.videos-page-btn.active {
    background: #dd1515 !important;
    border-color: #dd1515 !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(221, 21, 21, 0.22) !important;
}

.videos-nav-btn:disabled,
.videos-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none !important;
}

#page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: #999;
    font-weight: 700;
}

.form-group {
    margin-bottom: 22px !important;
}

label {
    color: #4d2828 !important;
    font-size: 0.94rem !important;
    font-weight: 700 !important;
}

input[type="text"],
input[type="file"],
textarea {
    width: 100%;
    padding: 12px 14px !important;
    border: 1px solid rgba(146, 24, 24, 0.16) !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #2d2d2d !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

input:focus,
textarea:focus {
    border-color: var(--videos-rojo) !important;
    box-shadow: 0 0 0 4px rgba(221, 21, 21, 0.12) !important;
    outline: none;
}

.file-info,
.progress-container,
.progress-bar {
    border-radius: 16px !important;
}

.mensaje {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: min(360px, calc(100vw - 24px));
    padding: 14px 18px;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 20px 40px rgba(32, 18, 18, 0.22);
    animation: videosSlideIn 0.24s ease;
}

.mensaje.success {
    background: linear-gradient(135deg, #198754 0%, #13653f 100%);
}

.mensaje.error {
    background: linear-gradient(135deg, #b4232c 0%, #81131a 100%);
}

.file-info {
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(146, 24, 24, 0.1) !important;
}

.progress-bar {
    background: #e5dede !important;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--videos-rojo) 0%, #f26d5c 100%) !important;
    color: #fff;
    font-weight: 700;
}

@keyframes videosSlideIn {
    from {
        opacity: 0;
        transform: translate3d(20px, -10px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

#loadingConversion {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, var(--videos-superficie) 0%, var(--videos-superficie-alt) 100%);
    padding: 26px;
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    z-index: 10000;
    text-align: center;
    min-width: min(320px, calc(100vw - 24px));
    border: 1px solid var(--videos-borde);
}

.loading-conversion-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.loading-conversion-barra {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.loading-conversion-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #dd1515, #b81111);
    animation: loadingConversion 1.5s ease-in-out infinite;
}

@keyframes loadingConversion {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.form-actions,
.video-actions,
.buttons-container {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal {
    background: rgba(17, 11, 11, 0.78) !important;
}

.modal-content {
    padding: 0 !important;
    overflow: hidden;
}

.modal-info {
    border-radius: 0 0 22px 22px !important;
}

.no-videos {
    padding: 46px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--videos-borde);
    border-radius: 22px;
    box-shadow: var(--videos-sombra);
}

.no-videos i {
    color: rgba(221, 21, 21, 0.38) !important;
}

@media (max-width: 768px) {
    .main-content,
    .container {
        padding: 24px 12px 44px !important;
    }

    .header-videos-flex,
    .videos-hero.videos-admin-hero,
    .videos-heading-row {
        grid-template-columns: 1fr;
    }

    .videos-admin-search {
        justify-self: stretch;
    }

    .videos-search-counter,
    .videos-admin-search-counter,
    .page-title-left {
        text-align: center !important;
    }

    .content-box,
    .form-container,
    .modal-info,
    .videos-admin-panel {
        padding: 20px !important;
        border-radius: 18px !important;
    }

    .btn-volver,
    .volver,
    .btn-volver-video,
    .btn-volver-admin,
    .btn-submit,
    .btn-cancelar,
    .btn-editar,
    .btn-eliminar,
    .pagination button {
        width: 100%;
    }

    #loadingConversion {
        min-width: auto;
        width: calc(100vw - 20px);
        padding: 22px 16px;
    }
}

@media (min-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .videos-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1300px) {
    .videos-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}