import { createTheme } from "@mui/material/styles";
import { theme as adminTheme } from "@/theme.js";

// The partner-facing app ships its own black-gold identity instead of the internal
// admin's light palette; component overrides are reused because they resolve through
// CSS tokens that external-admin/src/styles/index.css re-defines for this bundle.
const palette = {
  mode: "dark",
  primary: {
    main: "#d6b56e",
    light: "#ecd7a0",
    dark: "#a8823f",
    contrastText: "#1a1206"
  },
  secondary: {
    main: "#9c8a5e"
  },
  success: {
    main: "#66bd8b"
  },
  warning: {
    main: "#d9a441"
  },
  error: {
    main: "#e07b6d"
  },
  info: {
    main: "#9fb4cc"
  },
  background: {
    default: "#0d0d11",
    paper: "#16161c"
  },
  text: {
    primary: "#f0e9d8",
    secondary: "#b8ad92",
    disabled: "#7d7460"
  },
  divider: "rgba(214, 181, 110, 0.16)"
};

export function createExternalTheme(direction) {
  return createTheme({
    direction,
    palette,
    typography: {
      fontFamily: 'Inter, "Noto Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif',
      fontSize: 14,
      button: {
        fontSize: 14,
        textTransform: "none",
        fontWeight: 650
      },
      h5: {
        fontSize: 20,
        fontWeight: 700,
        letterSpacing: "0.01em"
      },
      h6: {
        fontSize: 17,
        fontWeight: 700
      }
    },
    shape: {
      borderRadius: 10
    },
    components: adminTheme.components
  });
}
