/* assets/css/admin.css */
body { font-family: sans-serif; margin: 0; background-color: #f4f6f9; color: #333; }
.admin-wrapper { display: flex; }
.sidebar { width: 250px; background-color: #343a40; color: #fff; min-height: 100vh; padding: 15px; }
.sidebar h3 { text-align: center; color: #fff; margin-bottom: 30px; font-size: 1.5rem; }
.sidebar ul { list-style: none; padding: 0; }
.sidebar ul li a { color: #c2c7d0; text-decoration: none; display: block; padding: 10px 15px; border-radius: 4px; transition: background-color 0.3s, color 0.3s; }
.sidebar ul li a:hover, .sidebar ul li.active a { background-color: #494e53; color: #fff; }
.sidebar hr { border-color: #4f5962; margin: 15px 0; }

.main-content { flex-grow: 1; }
.main-header { background: #fff; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dee2e6; }
.main-header h2 { margin: 0; font-size: 1.2rem; }
.main-header .logout-btn { background: #dc3545; color: white; padding: 8px 15px; text-decoration: none; border-radius: 4px; }
.main-header .logout-btn:hover { background: #c82333; }
.content { padding: 30px; }

/* Estilos para Tablas */
.content-table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); }
.content-table thead tr { background-color: #007bff; color: #ffffff; text-align: left; }
.content-table th, .content-table td { padding: 12px 15px; }
.content-table tbody tr { border-bottom: 1px solid #dddddd; }
.content-table tbody tr:nth-of-type(even) { background-color: #f3f3f3; }
.content-table tbody tr:last-of-type { border-bottom: 2px solid #007bff; }
.action-btn { padding: 5px 10px; margin-right: 5px; text-decoration: none; color: white; border-radius: 3px; }
.btn-edit { background-color: #ffc107; }
.btn-delete { background-color: #dc3545; }

/* Estilos para Formularios */
.form-container { background: #fff; padding: 20px; border-radius: 5px; margin-top: 20px; max-width: 600px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input[type="text"], .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-group textarea { height: 100px; resize: vertical; }
.btn-submit { background-color: #28a745; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; }
.btn-submit:hover { background-color: #218838; }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }


/* ... (todos los estilos anteriores) ... */

/* Estilos para Badges de Planes */
.plan-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
}

.plan-gratuito {
    background-color: #6c757d; /* Gris */
}

.plan-pro {
    background-color: #007bff; /* Azul */
}

/* Añadimos un estilo para un futuro botón de "Ver" */
.btn-view {
    background-color: #17a2b8; /* Cyan */
}


.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}
.thumbnail {
    position: relative;
    width: 100px;
    height: 100px;
}
.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.delete-thumb {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}


/* ... en la etiqueta <style> o en admin.css ... */
.work-item-modal label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.work-item-modal input[type="checkbox"] {
    margin-bottom: 10px;
    transform: scale(1.5);
}
.work-item-modal img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    margin-bottom: 5px;
}
.work-item-modal span {
    font-size: 0.9em;
    text-align: center;
}





/* Estilos para el Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 20px; border-radius: 8px; width: 80%; max-width: 900px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 15px; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.modal-body { overflow-y: auto; }
.library-grid-modal { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.file-item-modal { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 10px; border: 2px solid transparent; border-radius: 4px; }
.file-item-modal:hover { border-color: #007bff; background: #f8f9fa; }
.file-item-modal .preview { width: 100%; height: 80px; display: flex; align-items: center; justify-content: center; margin-bottom: 5px; }
.file-item-modal .preview img { max-width: 100%; max-height: 100%; object-fit: cover; }
.file-item-modal .preview .icon { font-size: 48px; color: #6c757d; }
.file-item-modal span { font-size: 0.85em; text-align: center; word-break: break-all; }


/* Estilos para el modal de vista previa */
.modal-preview {
    width: 90%;
    max-width: 1200px;
}
#preview-modal-body {
    /* Simulamos el fondo de la página pública */
    background-color: #f8f9fa; 
    padding: 20px;
    /* Necesario para que los plugins de JS se rendericen correctamente */
    min-height: 60vh; 
}


/* Estilo para el elemento "fantasma" que se ve al arrastrar */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

.module-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #fff; border: 1px solid #ddd; margin-bottom: 10px; border-radius: 4px; }
.module-item:hover { cursor: grab; }





