/* Botón para abrir popup */
.popup-diseno-boton {
    background: white;
    color: #003366;
    border: 2px solid #003366;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: inherit;
}

.popup-diseno-boton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: #f8f9fa;
}

/* Overlay del popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.popup-overlay.active {
    display: flex;
}

/* Contenedor del popup */
.popup-container {
    background: white;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

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

/* Header del popup */
.popup-header {
    background: linear-gradient(135deg, #003366 0%, #001f3f 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 {
    margin: 0;
    font-size: 24px;
}

.popup-cerrar {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.popup-cerrar:hover {
    transform: scale(1.1);
}

/* Formulario */
#formPopupDiseno {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

/* Selectores de categoría y subcategoría */
.categoria-select,
.subcategoria-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.subcategoria-select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Selector de productos */
.productos-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.producto-select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.btn-agregar {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: bold;
}

.btn-agregar:hover {
    background: #45a049;
}

/* Productos seleccionados */
.productos-seleccionados {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.producto-item {
    background: #f5f5f5;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.producto-imagen {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.producto-info {
    flex: 1;
}

.producto-nombre {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.producto-link {
    font-size: 12px;
    color: #003366;
    text-decoration: none;
}

.producto-link:hover {
    text-decoration: underline;
}

.btn-eliminar {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.btn-eliminar:hover {
    background: #d32f2f;
}

/* Campos de entrada */
.input-cantidad,
.input-fecha,
.input-tematica,
.input-ubicacion {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.input-ubicacion {
    margin-top: 8px;
}

.input-ubicacion:first-of-type {
    margin-top: 0;
}

/* Área de archivo */
.area-archivo {
    margin-top: 10px;
}

.input-archivo {
    display: block;
    margin-bottom: 10px;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.preview-archivo {
    max-width: 200px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 10px;
}

.preview-archivo img {
    width: 100%;
    height: auto;
}

.archivo-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    color: #003366;
}

.nota-archivo {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* Textarea de detalles */
.input-detalles {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

/* Botón enviar */
.btn-enviar {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #003366 0%, #001f3f 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-enviar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Checkbox */
.toggle-archivo {
    margin-right: 8px;
    cursor: pointer;
}

/* Scrollbar personalizada */
.popup-container::-webkit-scrollbar {
    width: 8px;
}

.popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.popup-container::-webkit-scrollbar-thumb {
    background: #003366;
    border-radius: 4px;
}

.popup-container::-webkit-scrollbar-thumb:hover {
    background: #001f3f;
}

/* Responsive */
@media (max-width: 768px) {
    .productos-selector {
        flex-direction: column;
    }
    
    .producto-select {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-agregar {
        width: 100%;
    }
    
    .popup-header h2 {
        font-size: 20px;
    }
    
    .producto-item {
        flex-wrap: wrap;
    }
    
    .btn-eliminar {
        position: absolute;
        top: 5px;
        right: 5px;
    }
}