/* ======================================================================
   MANAGE MY PACKS - ESTILOS COMPLETOS
   ====================================================================== */

.manage-packs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.page-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Filtros */
.packs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1em;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #667eea;
    outline: none;
}

.btn-refresh {
    padding: 10px 20px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    background: #3182ce;
}

/* Estadísticas */
.packs-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.stat-item.published {
    background: #f0fff4;
    border-color: #9ae6b4;
}

.stat-item.pending {
    background: #fffaf0;
    border-color: #feebc8;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-label {
    color: #718096;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lista de packs */
.packs-list-container {
    margin-top: 30px;
}

.packs-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pack-item {
    padding: 25px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
}

.pack-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.pack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pack-title {
    margin: 0;
    color: #2d3748;
    font-size: 1.3em;
    flex: 1;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.published {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.pending {
    background: #feebc8;
    color: #744210;
}

.status-badge.draft {
    background: #e2e8f0;
    color: #4a5568;
}

.pack-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.meta-item {
    color: #4a5568;
    font-size: 0.9em;
}

.meta-item strong {
    color: #2d3748;
    margin-right: 5px;
}

.pack-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pack-actions a,
.pack-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-view {
    background: #4299e1;
    color: white;
    border: none;
}

.btn-edit-admin {
    background: #ed8936;
    color: white;
    border: none;
}

.btn-edit {
    background: #48bb78;
    color: white;
    border: none;
}

.btn-delete {
    background: #f56565;
    color: white;
    border: none;
}

.btn-view:hover { background: #3182ce; }
.btn-edit-admin:hover { background: #dd6b20; }
.btn-edit:hover { background: #38a169; }
.btn-delete:hover { background: #e53e3e; }

.pack-preview {
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pack-thumbnail {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.pack-info {
    flex: 1;
}

.pack-excerpt {
    color: #4a5568;
    margin-top: 0;
    line-height: 1.5;
}

.pack-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.video-link, .drive-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-link:hover, .drive-link:hover {
    text-decoration: underline;
}

.no-packs, .loading-packs {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1em;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #f56565;
    background: #fff5f5;
    border-radius: 10px;
    border: 1px solid #fed7d7;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #718096;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #2d3748;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Formulario de edición */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.readonly-info {
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.info-row {
    margin-bottom: 8px;
    color: #4a5568;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row strong {
    color: #2d3748;
    margin-right: 5px;
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.85em;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-cancel {
    padding: 12px 25px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-save, .btn-delete-confirm {
    padding: 12px 25px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-delete-confirm {
    background: #f56565;
}

.btn-cancel:hover { background: #cbd5e0; }
.btn-save:hover { background: #38a169; }
.btn-delete-confirm:hover { background: #e53e3e; }

.updating {
    padding: 15px;
    background: #ebf8ff;
    border-radius: 6px;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
    text-align: center;
}

.success {
    padding: 15px;
    background: #f0fff4;
    border-radius: 6px;
    border: 1px solid #9ae6b4;
    color: #276749;
    text-align: center;
}

.error {
    padding: 15px;
    background: #fff5f5;
    border-radius: 6px;
    border: 1px solid #fed7d7;
    color: #c53030;
    text-align: center;
}

/* Modal de confirmación de borrado */
.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Notificaciones flotantes */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: #48bb78;
}

.notification.error {
    background: #f56565;
}

/* Responsive */
@media (max-width: 768px) {
    .manage-packs-container {
        padding: 20px;
    }
    .packs-filters {
        flex-direction: column;
    }
    .filter-group {
        min-width: 100%;
    }
    .btn-refresh {
        align-self: stretch;
    }
    .packs-stats {
        flex-direction: column;
    }
    .stat-item {
        min-width: 100%;
    }
    .pack-preview {
        flex-direction: column;
    }
    .pack-thumbnail {
        width: 100%;
        height: 200px;
    }
    .pack-actions {
        flex-direction: column;
    }
    .pack-actions a,
    .pack-actions button {
        width: 100%;
        justify-content: center;
    }
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    .form-actions,
    .modal-actions {
        flex-direction: column;
    }
}