/* 
 * Basecoat UI - Nature-Tech Color System
 * Custom theme file for Top-Serre with shadcn/Basecoat compatibility
 * 
 * This file defines CSS custom properties in HSL format for shadcn/Basecoat UI
 * and provides custom utilities like glassmorphism.
 */

/* ========================================================================
   Nature-Tech Color Palette (HSL format for shadcn compatibility)
   ======================================================================== */

:root {
    /* === Nature-Tech Brand Colors === */
    --forest-deep: 165 45% 10%;
    /* #0B2B26 - Primary dark background */
    --glass-white: 0 0% 100%;
    /* #FFFFFF - Glassmorphic base */
    --clay-accent: 30 75% 50%;
    /* #D98324 - Accent/warning (orange) */
    --neon-leaf: 142 76% 59%;
    /* #4ADE80 - Success/primary (green) */

    /* === shadcn/Basecoat Semantic Tokens === */
    /* These map to Basecoat UI's expected variable names */
    --background: 0 0% 98%;
    /* Light page background */
    --foreground: 165 45% 10%;
    /* Dark text (forest-deep) */

    --card: 0 0% 100%;
    /* White cards */
    --card-foreground: 165 45% 10%;
    /* Dark text on cards */

    --popover: 0 0% 100%;
    --popover-foreground: 165 45% 10%;

    --primary: 142 76% 36%;
    /* Darker green for better contrast */
    --primary-foreground: 0 0% 100%;
    /* White text on primary */

    --secondary: 0 0% 96%;
    /* Light gray */
    --secondary-foreground: 165 45% 10%;

    --muted: 0 0% 96%;
    --muted-foreground: 0 0% 45%;

    --accent: 30 75% 50%;
    /* Clay accent (orange) */
    --accent-foreground: 0 0% 100%;
    /* White text on accent */

    --destructive: 0 84% 60%;
    /* Red for errors */
    --destructive-foreground: 0 0% 100%;

    --border: 0 0% 90%;
    --input: 0 0% 90%;
    --ring: 142 76% 36%;
    /* Focus ring = primary green */

    --radius: 0.75rem;
    /* 12px - slightly rounded */

    /* === Chart colors (if needed) === */
    --chart-1: 142 76% 36%;
    --chart-2: 30 75% 50%;
    --chart-3: 199 89% 39%;
    --chart-4: 343 82% 41%;
    --chart-5: 160 84% 39%;
}

/* ========================================================================
   Dark Mode Support (optional)
   ======================================================================== */

.dark {
    --background: 165 45% 6%;
    /* Darker forest */
    --foreground: 0 0% 98%;
    /* Light text */

    --card: 165 45% 10%;
    /* Forest deep cards */
    --card-foreground: 0 0% 98%;

    --popover: 165 45% 10%;
    --popover-foreground: 0 0% 98%;

    --primary: 142 76% 59%;
    /* Brighter neon-leaf */
    --primary-foreground: 165 45% 10%;

    --secondary: 0 0% 15%;
    --secondary-foreground: 0 0% 98%;

    --muted: 0 0% 15%;
    --muted-foreground: 0 0% 64%;

    --accent: 30 75% 50%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;

    --border: 0 0% 15%;
    --input: 0 0% 15%;
    --ring: 142 76% 59%;
}

/* ========================================================================
   Custom Utilities
   ======================================================================== */

/* Glassmorphism Portal Effect */
.glass-portal {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: hsl(var(--glass-white) / 0.6);
    border: 1px solid hsl(var(--glass-white) / 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Lighter glass variant */
.glass-light {
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    background: hsl(var(--glass-white) / 0.8);
    border: 1px solid hsl(var(--glass-white) / 0.5);
}

/* Dark glass for dark backgrounds */
.glass-dark {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: hsl(var(--forest-deep) / 0.8);
    border: 1px solid hsl(var(--glass-white) / 0.1);
}

/* ========================================================================
   Category Colors (for product badges)
   ======================================================================== */

.category-accessoires {
    --cat-color: 199 89% 39%;
}

/* #0284c7 - Blue */
.category-premium {
    --cat-color: 343 82% 41%;
}

/* #be123c - Red */
.category-orangeries {
    --cat-color: 20 91% 48%;
}

/* #ea580c - Orange */
.category-serres {
    --cat-color: 160 84% 39%;
}

/* #059669 - Green */
.category-tunnel {
    --cat-color: 30 86% 31%;
}

/* #92400e - Brown */

/* Category badge using Basecoat's badge as base */
.category-badge {
    background: hsl(var(--cat-color) / 0.1);
    color: hsl(var(--cat-color));
    border: 1px solid hsl(var(--cat-color) / 0.2);
}

/* ========================================================================
   Basecoat Component Overrides / Customizations
   ======================================================================== */

/* Primary button with Nature-Tech green */
.btn-primary {
    --btn-bg: hsl(var(--primary));
    --btn-fg: hsl(var(--primary-foreground));
    --btn-hover-bg: hsl(142 76% 30%);
    /* Slightly darker on hover */
}

/* Accent button (orange) */
.btn-accent {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-accent:hover {
    background: hsl(30 75% 45%);
    /* Darker orange */
}

/* Card with subtle shadow */
.card {
    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Input focus with green ring */
.input:focus,
.textarea:focus,
.select:focus {
    --ring-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* ========================================================================
   Smooth Transitions for all interactive elements
   ======================================================================== */

.btn,
.card,
.badge,
.input,
.textarea,
.select,
.alert,
[class*="btn-"] {
    transition: all 0.2s ease;
}

/* ========================================================================
   Legacy Variable Mapping (for backward compatibility)
   Maps old --color-primary-X variables to new Basecoat tokens
   ======================================================================== */

:root {
    /* These aliases help existing code work with new Basecoat system */
    /* Remove these once full migration is complete */

    /* Keep original variables as HSL equivalents */
    --color-primary-hsl: 142 76% 36%;
    --color-accent-hsl: 0 84% 60%;
    --color-neutral-900-hsl: 165 45% 10%;
}