@tailwind base;
@tailwind components;
@tailwind utilities;

/* Import chart color constants */
@import "chart_colors.css";

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/* Modern SCADA Auth - Clean & Professional */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-page {
  min-height: 100vh;
  background: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

/* Brand */
.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1E90FF 0%, #3E5C99 100%);
  border-radius: 16px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(30, 144, 255, 0.2);
  animation: fadeInDown 0.6s ease;
}

.auth-logo svg {
  width: 32px;
  height: 32px;
  color: white;
  stroke-width: 2.5;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.03em;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.auth-subtitle {
  font-size: 1rem;
  color: #6B7280;
  margin: 0;
  font-weight: 500;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* Card */
.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 20px 40px -10px rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.6s ease 0.3s both;
}

/* Form */
.auth-form-group {
  margin-bottom: 1.5rem;
}

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}

.auth-input-wrapper {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9CA3AF;
  pointer-events: none;
  stroke-width: 2;
}

.auth-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  font-size: 0.9375rem;
  color: #111827;
  background: #F9FAFB;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.auth-input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}

.auth-input:hover {
  background: #F3F4F6;
}

.auth-input:focus {
  outline: none;
  background: white;
  border-color: #1E90FF;
  box-shadow: 0 0 0 4px rgba(30, 144, 255, 0.1);
}

/* Checkbox */
.auth-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.auth-checkbox-group {
  display: flex;
  align-items: center;
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  margin: 0 0.625rem 0 0;
  cursor: pointer;
  accent-color: #1E90FF;
}

.auth-checkbox-label {
  font-size: 0.875rem;
  color: #6B7280;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

/* Links */
.auth-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1E90FF;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.auth-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #1E90FF;
  transition: width 0.2s ease;
}

.auth-link:hover {
  color: #3E5C99;
}

.auth-link:hover::after {
  width: 100%;
}

/* Button */
.auth-button {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #1E90FF 0%, #3E5C99 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(30, 144, 255, 0.3);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.auth-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3E5C99 0%, #1E90FF 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-button:hover::before {
  opacity: 1;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 144, 255, 0.4);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button span {
  position: relative;
  z-index: 1;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #6B7280;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.auth-footer a {
  color: #1E90FF;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  color: #3E5C99;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-title {
    font-size: 1.75rem;
  }
}
/**
 * Chart Color Variables
 * Mirrors app/javascript/constants/chart_colors.js
 * Used for both ECharts visualizations and UI elements
 */

:root {
  /* Indigo - For SCADA/Entrada data */
  --chart-indigo-main: #6366F1;
  --chart-indigo-hover: #4F46E5;
  --chart-indigo-gradient-start: rgba(99, 102, 241, 0.2);
  --chart-indigo-gradient-end: rgba(99, 102, 241, 0.02);

  /* Teal - For Billed/Facturado data */
  --chart-teal-main: #14B8A6;
  --chart-teal-hover: #0D9488;
  --chart-teal-gradient-start: rgba(20, 184, 166, 0.2);
  --chart-teal-gradient-end: rgba(20, 184, 166, 0.02);

  /* Amber/Green - For Losses/Pérdidas data */
  --chart-amber-main: #A1CCA6;
  --chart-amber-hover: #739177;

  /* Loss severity levels (for percentage-based visualizations) */
  --chart-loss-high: #739177;      /* > 40% - darkest */
  --chart-loss-medium-high: #8BA67F; /* > 30% */
  --chart-loss-medium: #A1CCA6;    /* > 20% - main color */
  --chart-loss-low: #B8D9BD;       /* <= 20% - lightest */

  /* Axis colors */
  --chart-axis-line: #9CA3AF;
  --chart-axis-label: #6B7280;
  --chart-axis-split: #E5E7EB;
}

/**
 * Series Toggle Button Classes
 * For series selection buttons in dashboard views
 */
.series-btn-indigo {
  background-color: var(--chart-indigo-main);
}

.series-btn-indigo:hover {
  background-color: var(--chart-indigo-hover);
}

.series-btn-teal {
  background-color: var(--chart-teal-main);
}

.series-btn-teal:hover {
  background-color: var(--chart-teal-hover);
}

.series-btn-amber {
  background-color: var(--chart-amber-main);
}

.series-btn-amber:hover {
  background-color: var(--chart-amber-hover);
}
/* Pagy Custom SCADA Theme */
/* Pagination styling with SCADA brand colors */

/* Main pagination container */
.pagy-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
}

/* Base style for all pagination items (spans) */
.pagy-nav .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  color: #4b5563;
  background-color: #ffffff;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Links inside page spans should inherit styles */
.pagy-nav .page a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Hover state for non-active, non-disabled pages */
.pagy-nav .page:has(a):hover,
.pagy-nav .page:not(.disabled):not(.active):hover {
  background-color: #f9fafb;
  border-color: #3E5C99;
  color: #1E90FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(30, 144, 255, 0.1);
}

/* Active (current) page */
.pagy-nav .page.active {
  background: linear-gradient(135deg, #1E90FF 0%, #3E5C99 100%);
  border-color: #1E90FF;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(30, 144, 255, 0.3), 0 4px 6px -2px rgba(30, 144, 255, 0.15);
  cursor: default;
}

.pagy-nav .page.active:hover {
  box-shadow: 0 20px 25px -5px rgba(30, 144, 255, 0.4), 0 10px 10px -5px rgba(30, 144, 255, 0.2);
  transform: translateY(-2px);
}

/* Previous/Next buttons */
.pagy-nav .page.prev,
.pagy-nav .page.next {
  font-weight: 700;
  min-width: 5rem;
  padding: 0 1.25rem;
}

/* Disabled state */
.pagy-nav .page.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #f9fafb;
  border-color: #e5e7eb;
  color: #9ca3af;
}

.pagy-nav .page.disabled:hover {
  transform: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

/* Gap indicator (ellipsis) */
.pagy-nav .page.gap {
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: none;
  color: #9ca3af;
  box-shadow: none;
  min-width: 2rem;
}

.pagy-nav .page.gap:hover {
  background: transparent;
  border: none;
  transform: none;
  box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .pagy-nav {
    gap: 0.375rem;
    padding: 1rem 0;
  }

  .pagy-nav .page {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
  }

  .pagy-nav .page.prev,
  .pagy-nav .page.next {
    min-width: 3rem;
    padding: 0 0.75rem;
  }
}
/**
 * Slim Select Custom SCADA Theme
 * Overrides for matching SCADA design
 */

/* Main container */
.ss-main {
  width: 100%;
}

.ss-main .ss-single-selected {
  background-color: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  min-height: 42px;
  font-weight: 600;
  color: #374151;
  transition: all 0.2s ease;
}

.ss-main .ss-single-selected:hover {
  border-color: #9ca3af;
}

.ss-main.ss-open-above .ss-single-selected,
.ss-main.ss-open-below .ss-single-selected {
  border-color: #1E90FF;
  box-shadow: 0 0 0 4px rgba(30, 144, 255, 0.1);
}

/* Arrow */
.ss-main .ss-single-selected .ss-arrow {
  border-color: #6b7280;
}

.ss-main.ss-open-above .ss-single-selected .ss-arrow,
.ss-main.ss-open-below .ss-single-selected .ss-arrow {
  border-color: #1E90FF;
}

/* Dropdown content */
.ss-content {
  background-color: #ffffff;
  border: 2px solid #1E90FF;
  border-radius: 0.75rem;
  margin-top: 4px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Search input */
.ss-content .ss-search input {
  background-color: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #374151;
}

.ss-content .ss-search input:focus {
  border-color: #1E90FF;
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

.ss-content .ss-search input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* Options list */
.ss-content .ss-list {
  max-height: 300px;
}

.ss-content .ss-list .ss-option {
  padding: 0.5rem 1rem;
  color: #374151;
  font-weight: 500;
  transition: all 0.15s ease;
}

.ss-content .ss-list .ss-option:hover,
.ss-content .ss-list .ss-option.ss-highlighted {
  background-color: rgba(30, 144, 255, 0.1);
  color: #1E90FF;
}

.ss-content .ss-list .ss-option.ss-disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
}

.ss-content .ss-list .ss-option.ss-selected {
  background-color: #1E90FF;
  color: #ffffff;
  font-weight: 600;
}

/* No results message */
.ss-content .ss-search .ss-addable {
  padding: 0.75rem 1rem;
  color: #6b7280;
  text-align: center;
  font-size: 0.875rem;
}

/* Scrollbar */
.ss-content .ss-list::-webkit-scrollbar {
  width: 8px;
}

.ss-content .ss-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.ss-content .ss-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.ss-content .ss-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Loading state */
.ss-main.ss-disabled .ss-single-selected {
  background-color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.6;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
