"""Application configuration."""
import os
from pathlib import Path

# Project paths
BACKEND_DIR = Path(__file__).resolve().parent
PROJECT_ROOT = BACKEND_DIR.parent.parent.parent

# Database (SQLite for Phase 2, migrate to PostgreSQL later)
DB_PATH = os.environ.get("AFM_DB_PATH", str(BACKEND_DIR / "afm_sim.db"))
DATABASE_URL = f"sqlite:///{DB_PATH}"

# Server
HOST = os.environ.get("AFM_HOST", "127.0.0.1")
PORT = int(os.environ.get("AFM_PORT", "8000"))

# CORS (allow frontend dev server)
CORS_ORIGINS = os.environ.get(
    "AFM_CORS_ORIGINS",
    "http://localhost:5173,http://127.0.0.1:5173,http://localhost:3000"
).split(",")

# App metadata
APP_NAME = "PCB Axial Flux Motor Simulation System"
APP_VERSION = "0.1.0"
APP_DESCRIPTION = "Web-based simulation plan generation and optimization system for PCB axial flux motors"
