#!/usr/bin/env bash

set -e

BASE_DIR="wwwroot/assets"
CSS_DIR="$BASE_DIR/css"
FONTS_DIR="$BASE_DIR/fonts"

echo "📁 Creando carpetas..."
mkdir -p "$CSS_DIR" "$FONTS_DIR"

echo "⬇️ Descargando CSS..."

# Bootstrap Icons
curl -L -o "$CSS_DIR/bootstrap-icons.min.css" \
https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css

# Font Awesome
curl -L -o "$CSS_DIR/fontawesome.min.css" \
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css

# Toastr
curl -L -o "$CSS_DIR/toastr.min.css" \
https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css

# SweetAlert2
curl -L -o "$CSS_DIR/sweetalert2.min.css" \
https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css

echo "⬇️ Descargando Google Font (Inter)..."

# Descargar CSS de Google Fonts
curl -L -o "$CSS_DIR/inter.css" \
"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"

echo "⚠️ Nota:"
echo "Google Fonts usa URLs dinámicas."
echo "Abre inter.css, descarga los .woff2 referenciados"
echo "y ajusta las rutas a ../fonts/"

echo "✅ Descargas completadas"
