@import "tailwindcss";

/* Design System - Globals */
@custom-variant dark (&:is(.dark *));

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@400;500;600;700&display=swap');
/* Note: Futura is not available on Google Fonts. Use a system font fallback or load Futura separately */
/* Alternative: Use 'Futura PT' or similar geometric sans-serif fonts */

:root {
  --font-size: 16px;
  --background: #FFF;
  --foreground: #081B43;
  --card: #FFF;
  --card-foreground: #081B43;
  --popover: #FFF;
  --popover-foreground: #081B43;
  --primary: #86C2FF;
  --primary-foreground: #081B43;
  --secondary: #86C2FF;
  --secondary-foreground: #081B43;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #081B43;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: #86C2FF;
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --sidebar: #FFF;
  --sidebar-foreground: #081B43;
  --sidebar-primary: #86C2FF;
  --sidebar-primary-foreground: #081B43;
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: #081B43;
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: #86C2FF;
  
  /* Design System Colors */
  --color-neon-blue: #86C2FF;
  --color-marine-blue: #081B43;
  --color-white: #FFF;
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

html {
  font-size: var(--font-size);
}

/* Typography */
body {
  font-family: 'Futura', 'Futura PT', 'Avenir', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Azeret Mono', monospace;
}

/* Custom utility classes */
.container-app {
  margin-left: auto;
  margin-right: auto;
  max-width: 80rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-app {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-app {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.grid-list {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Component Styles */

/* Card Component */
.card {
  background-color: var(--color-card);
  color: var(--color-card-foreground);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(134, 194, 255, 0.35);
}

/* Button Base */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-destructive {
  display: inline-flex;
  align-items: center;
  justify-center: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms;
  height: 2.25rem;
  padding: 0.5rem 1rem;
  outline: none;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-outline:disabled,
.btn-ghost:disabled,
.btn-destructive:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible,
.btn-ghost:focus-visible,
.btn-destructive:focus-visible {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}

.btn-secondary:hover {
  opacity: 0.8;
}

.btn-outline {
  border: 1px solid var(--color-border);
  background-color: var(--color-background);
  color: var(--color-foreground);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

.btn-ghost:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

/* Ensure SVG icons are visible in buttons */
.btn-ghost svg,
.btn-ghost a svg {
  display: block;
  flex-shrink: 0;
  color: currentColor;
}

.btn-destructive {
  background-color: var(--color-destructive);
  color: white;
}

.btn-destructive:hover {
  opacity: 0.9;
}

.btn-destructive:focus-visible {
  box-shadow: 0 0 0 3px rgba(212, 24, 61, 0.2);
}

/* New Design System Button Component
 * Usage:
 *   Primary: <button class="btn-design btn-design-primary">Button Text</button>
 *   Secondary: <button class="btn-design btn-design-secondary">Button Text</button>
 *   As link: <a href="#" class="btn-design btn-design-primary">Button Text</a>
 */
.btn-design {
  display: flex;
  width: 302px;
  height: 44px;
  padding: 10px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  border: 1px solid #86C2FF;
  mix-blend-mode: plus-lighter;
  box-shadow: 0 2px 12px 0 #86C2FF;
  font-family: 'Futura', 'Futura PT', 'Avenir', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  outline: none;
}

.btn-design:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-design:focus-visible {
  outline: 2px solid #86C2FF;
  outline-offset: 2px;
}

/* Primary Button Variant */
.btn-design-primary {
  background: #86C2FF;
  color: #081B43;
}

.btn-design-primary:hover {
  background: #6BA8FF;
  box-shadow: 0 2px 16px 0 #86C2FF;
}

/* Secondary Button Variant */
.btn-design-secondary {
  background: #081B43;
  color: #86C2FF;
}

.btn-design-secondary:hover {
  background: #0A2150;
  box-shadow: 0 2px 16px 0 #86C2FF;
}

/* Input Component */
.input {
  display: flex;
  height: 2.25rem;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid var(--color-input);
  background-color: var(--color-input-background);
  padding: 0.25rem 0.75rem;
  font-size: 1rem;
  transition: all 150ms;
  outline: none;
  color: #081B43;
}

.input::placeholder {
  color: rgba(8, 27, 67, 0.6);
}

.input:focus-visible {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (min-width: 768px) {
  .input {
    font-size: 0.875rem;
  }
}

/* Label Component */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-background);
}

.navbar-inner {
  margin-left: auto;
  margin-right: auto;
  max-width: 80rem;
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  height: 4rem;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .navbar-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .navbar-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Fix for button_to forms in navbar */
.navbar-inner form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.navbar-inner form button {
  margin: 0;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  font-size: 0.875rem;
}

@layer components {
  .listing-card {
    @apply relative bg-[var(--color-marine-blue)] text-[var(--color-white)] overflow-hidden;
    height: 100%;
    /* FIXE : toutes les cards font la même hauteur */
    border-radius: 0;
    /* coins carrés */
    border: 1px solid rgba(134, 194, 255, 0.35);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }

  .listing-card:hover {
    border-color: var(--color-neon-blue);
    box-shadow: 0 0 20px rgba(134, 194, 255, 0.6), 0 0 40px rgba(134, 194, 255, 0.3);
  }

  .listing-card-image {
    height: 230px;
    width: 100%;
    @apply bg-[var(--color-muted)];
  }

  .listing-card-body {
    @apply px-5 py-4;
    border-top: none;
    min-height: 150px;
    background: color-mix(in srgb, var(--color-marine-blue) 90%, #000 10%);
  }
}

/* Home page search input placeholder */
.search-input-home::placeholder {
  color: #86C2FF;
  opacity: 1;
}

/* Conversation textarea placeholder */
textarea::placeholder {
  color: rgba(8, 27, 67, 0.6);
}

/* Kaminari Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(134, 194, 255, 0.35);
  background-color: var(--color-background);
  color: var(--color-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms;
}

.pagination a:hover {
  background-color: var(--color-accent);
  border-color: var(--color-neon-blue);
  color: var(--color-neon-blue);
}

.pagination .current {
  background-color: var(--color-neon-blue);
  color: var(--color-marine-blue);
  border-color: var(--color-neon-blue);
  font-weight: 600;
}

.pagination .disabled,
.pagination .disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .gap {
  border: none;
  background: transparent;
  cursor: default;
}
