/* --- ESTILOS GENERALES --- */
:root {
    --bg-color: #05040a;
    --card-bg: #11131b;
    --text-main: #f5f5f5;
    --text-muted: #9ca3af;
    --border-color: rgba(148, 163, 184, 0.2);
    --input-bg: #020617;
    --accent-color: #22c55e;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

/* --- TARJETA PRINCIPAL (CONTENEDOR FIJO) --- */
.card {
    background: var(--card-bg);
    border-radius: 0;
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* --- CABECERA FIJA --- */
.card-header {
    padding: 20px 28px 15px;
    flex-shrink: 0;
    /* No encoger */
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    z-index: 10;
    position: sticky;
    top: 0;
}

/* --- ROW BASED LAYOUT --- */
.admin-grid {
    flex: 1;
    /* Ocupa todo el espacio restante */
    display: grid;
    grid-template-columns: 1fr;
    /* 1 column = full width rows */
    gap: 0;
}

/* Estilizar las barras de desplazamiento (globales del navegador) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- SECCIONES INDIVIDUALES --- */
.panel-section {
    padding: 1.5rem;
    height: auto;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    padding-bottom: 2rem;
}

.panel-section:last-child {
    border-bottom: none;
}

/* --- RESPONSIVE CSS IS LOCATED AT THE BOTTOM OF THE FILE --- */
/* --- TIPOGRAFÍA Y COMPONENTES --- */
h1 {
    margin: 0 0 0.2rem;
    font-size: 1.4rem;
}

/* Títulos de sección pegajosos (Sticky) */
h2 {
    font-size: 1.1rem;
    margin: 0 0 1.5rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: -1.5rem;
    /* Ajustado al padding negativo */
    background: var(--card-bg);
    /* Fondo para tapar contenido al scrollear */
    padding: 1rem 0;
    z-index: 5;
    margin-top: -1.5rem;
    border-bottom: 1px dashed #333;
}

h3 {
    font-size: 0.85rem;
    margin: 1.5rem 0 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-left: 3px solid var(--accent-color);
    padding-left: 0.5rem;
}

.sub-panel {
    margin-bottom: 2rem;
}

.field {
    margin-bottom: 0.8rem;
}

.field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

input[type="color"] {
    height: 35px;
    padding: 2px;
    cursor: pointer;
}

.row {
    display: flex;
    gap: 0.5rem;
}

.row .field {
    flex: 1;
}

button {
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent-color);
    color: #022c22;
    font-weight: 700;
    width: 100%;
    justify-content: center;
    margin-top: 0.8rem;
}

#btn-logout {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

#btn-logout:hover {
    border-color: #fff;
    color: #fff;
}

#btn-login-google {
    background: white;
    color: black;
    width: 100%;
    justify-content: center;
}

.tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: 0.2rem;
}

.status-ok {
    color: #4ade80;
}

.status-error {
    color: #f97373;
}

.muted {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Upload box */
.upload-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 8px;
}

/* Modal */
dialog {
    border: none;
    outline: none;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #dc2626;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* SortableJS Styles - Clean & Native-compatible */
.sortable-ghost {
    opacity: 0.4;
    background: #e2e8f0;
    border: 2px dashed #94a3b8;
}

.sortable-drag {
    cursor: grabbing;
    opacity: 1 !important;
    background: transparent;
    margin: 0 !important;
    box-shadow: none;
    transform: none;
}

/* --- Extracted Inline Styles --- */

#login-view {
    display: none;
    /* JS toggles this */
    width: 100%;
    max-width: 400px;
    background: #11131b;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#admin-view {
    display: none;
    /* JS toggles this */
}

/* Utility Classes for Flexbox */
.flex-between-start {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.flex-gap-2-center {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.flex-col-gap-2 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flex-center-between-p1-border {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 58, 138, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #1e3a8a;
}

.flex-center-between-p1-border-purple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(147, 51, 234, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.separator-top {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.separator-bottom {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.text-bold-blue {
    font-weight: bold;
    color: #93c5fd;
}

.text-bold-purple {
    font-weight: bold;
    color: #d8b4fe;
}

/* Custom Overrides */
.hero-override {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-box {
    background: #020617;
    padding: 0.5rem;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #1e293b;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Nav Cards */
.nav-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.nav-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: 0.2s;
}

@media (max-width: 1024px) {
    .nav-card-container, .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Edit Dialog */
#edit-dialog {
    background: #11131b;
    color: white;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
}

#edit-desc {
    width: 100%;
    min-height: 60px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: white;
    border-radius: 6px;
    padding: 0.5rem;
}
.stat-label { font-size: 0.7rem; color: #94a3b8; }

.cursor-pointer { cursor: pointer; }
.block { display: block; }

.m-0 { margin: 0; }

/* --- ARCHIVE CALENDAR --- */
.archive-calendar-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 1rem;
    margin-top: 1.5rem;
}

/* Custom Scrollbar for container */
.archive-calendar-container::-webkit-scrollbar {
    width: 6px;
}
.archive-calendar-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.archive-calendar-container::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.calendar-month {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #0b0d13;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.calendar-month-title {
    position: sticky;
    top: 0;
    background: #0b0d13;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
    z-index: 2;
    border-bottom: 1px solid var(--border-color);
    text-transform: capitalize;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    font-weight: 600;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    cursor: default;
    color: #cbd5e1;
    transition: all 0.2s;
}

.calendar-day.empty {
    background: transparent;
    color: transparent;
}

.calendar-day.has-activity {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.has-activity:hover {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.2);
    transform: scale(1.05);
    z-index: 1;
}

.activity-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    bottom: 10%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Colors for activity types */
.activity-image { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; } /* Blue for images */
.activity-video { background: #ef4444; box-shadow: 0 0 6px #ef4444; } /* Red for videos */
.activity-text  { background: #a855f7; box-shadow: 0 0 6px #a855f7; } /* Purple for Text */
.activity-audio { background: #eab308; box-shadow: 0 0 6px #eab308; } /* Yellow for Audio */
.activity-mixed { background: #22c55e; box-shadow: 0 0 6px #22c55e; } /* Green for Mixed */

/* --- CALENDAR DAY PREVIEW --- */
#calendar-day-preview {
    background: #11131b;
    color: white;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
}

.calendar-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.calendar-preview-grid::-webkit-scrollbar {
    width: 6px;
}
.calendar-preview-grid::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.preview-item {
    aspect-ratio: 1;
    background: #020617;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-item:hover {
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.preview-item img, .preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-icon {
    font-size: 2rem;
    opacity: 0.6;
}

.preview-label {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    font-size: 0.7rem;
    text-align: center;
    padding: 4px 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* --- CALENDAR VIEW DROPDOWN --- */
.calendar-view-dropdown {
    position: fixed;
    background: rgba(17, 19, 27, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    min-width: 160px;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
}

.calendar-view-dropdown-header {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 6px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
    font-weight: bold;
}

.calendar-view-dropdown-item {
    background: transparent;
    border: none;
    color: #f5f5f5;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    display: block;
    width: 100%;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
}

.calendar-view-dropdown-item:hover {
    background: var(--accent-color);
    color: #022c22;
}

/* --- CALENDAR DASHBOARD SYSTEM --- */
.dashboard-container {
    box-sizing: border-box;
}

.media-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.media-card-thumb-container {
    transition: background-color 0.2s;
}

.carousel-section-card {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.carousel-section-card.pinned {
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    from {
        box-shadow: 0 0 8px rgba(236, 72, 153, 0.2);
    }
    to {
        box-shadow: 0 0 16px rgba(236, 72, 153, 0.5);
    }
}

.drag-hover-zone {
    border: 2px dashed #ec4899 !important;
    background: rgba(236, 72, 153, 0.05) !important;
    transform: scale(1.01);
}

.carousel-card-preview-strip::-webkit-scrollbar {
    height: 4px;
}
.carousel-card-preview-strip::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.carousel-card-preview-strip::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 2px;
}

/* Badge Utility Styles */
.badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
}
.badge-parent { background: #eab308; color: #000; }
.badge-child { background: #3b82f6; color: #fff; }
.badge-single { background: #64748b; color: #fff; }

/* Carousel Builder Selection Highlights */
.media-card.is-carousel-parent {
  box-shadow: 0 0 0 4px #f59e0b, 0 0 20px rgba(245, 158, 11, 0.5) !important;
  transform: scale(0.98);
  transition: all 0.2s ease;
}

.media-card.is-carousel-child {
  box-shadow: 0 0 0 4px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.5) !important;
  transform: scale(0.98);
  transition: all 0.2s ease;
}




