/* ==============================================================================
   G4 AMAZON TOOL - MAIN STYLES
   Variables, Reset, Base Styles
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;0,9..40,900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── LIGHT THEME (Orvimo-style: warm neutral outer frame + dark accent) ───── */
:root[data-theme="light"] {
    --primary: #2e2e2e;
    --primary-hover: #1f1f1f;
    --accent: #2e2e2e;

    /* Layer palette: cool neutral outer canvas → clean white cards */
    --bg-outer: #2e2e2e;
    --bg-main: #eef0f5;       /* cool blue-grey canvas */
    --bg-sidebar: #eef0f5;
    --bg-card: #ffffff;       /* cards are clean white */
    --bg-secondary: #f4f5f8;  /* neutral light grey */
    --bg-hover: #eaecf2;      /* neutral hover */

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e2e5ec;
    --border-light: #eef0f4;

    --dot-color: rgba(0, 0, 0, 0.13);  /* stronger — visible on white cards */

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

/* ── DARK THEME — Make.com / Orvimo style ─────────────────────────────── */
:root[data-theme="dark"] {
    /* Orange is accent-only: charts, rings, progress bars — NOT buttons */
    --primary: #f97316;
    --primary-hover: #ea6c0a;
    --accent: #f97316;

    /* Depth layers: sidebar/outer (lighter) → canvas (darker) → cards (slightly lighter) */
    --bg-outer:     #242424;   /* matches sidebar — seamless, no black gap */
    --bg-main:      #1f1f1f;   /* page canvas — slightly lighter than before */
    --bg-sidebar:   #242424;   /* sidebar rail */
    --bg-card:      #272727;   /* card surfaces — subtly lighter than canvas */
    --bg-secondary: #303030;   /* elements inside cards */
    --bg-hover:     #3a3a3a;   /* hover state */

    --text-primary:   #ffffff;  /* pure white titles (Make.com style) */
    --text-secondary: #c0c0c0;  /* body / list items — lighter, more readable */
    --text-muted:     #aaaaaa;  /* labels, subtitles — light grey, clearly readable */

    /* Dark ("black") card borders — visible outline against lighter card bg */
    --border-color: rgba(0, 0, 0, 0.70);
    --border-light: rgba(255, 255, 255, 0.06);

    --dot-color: rgba(255, 255, 255, 0.09);

    --success: #10b981;
    --danger:  #ef4444;
    --warning: #f59e0b;
    --info:    #3b82f6;

    /* Button palette — dark neutral, never orange */
    --btn-bg:       #2e2e2e;
    --btn-bg-hover: #383838;
    --btn-color:    #cccccc;
}

/* RESET & BASE STYLES */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header/page titles only: DM Sans bold — all other titles are Inter medium */
h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
}

/* Disable scroll anchoring globally — prevents the browser from re-scrolling
   the page when section tab content loads/changes height */
html {
    overflow-anchor: none;
}

body {
    background: var(--bg-outer);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

/* ============================================================================
   MAIN LAYOUT — Orvimo Layer Style
   Outer frame (body bg = sidebar bg) visible on top/right/bottom edges.
   Main content panel floats on top as a lighter canvas.
   ============================================================================ */

.main-content {
    margin-left: 80px;
    margin-top: 8px;
    margin-right: 8px;
    margin-bottom: 8px;
    min-height: calc(100vh - 16px);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Dark mode — floating panel preserved (same structure as light mode); only shadow removed */
[data-theme="dark"] .main-content {
    box-shadow: none;
}

/* Light mode — subtle lift shadow against dark outer bg */
[data-theme="light"] .main-content {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.18);
}

/* Transparent wrapper — structural container only */
.content-wrapper {
    background: transparent;
    border-radius: 0;
    min-height: calc(100vh - 16px);
    overflow: visible;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
}

/* Page content floats on the dot-grid canvas */
.page-content {
    padding: 20px 28px 36px;
    background: transparent;
    flex: 1;
    overflow-anchor: none; /* prevent scroll-anchoring from fighting our scroll reset */
}

/* Section tabs bar is now inside .top-header as last child — no page-content override needed */

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Cards and panels are solid layers on the canvas — no dot pattern on them */

/* SECTION SEPARATOR */
.section-separator {
    height: 2px;
    margin: 12px 0 20px 0;
    background-image: repeating-linear-gradient(
        to right,
        var(--border-color) 0px,
        var(--border-color) 4px,
        transparent 4px,
        transparent 8px
    );
}
