/* _styles.css */

@import url("https://cdn.jsdelivr.net/npm/tailwindcss@3.4.3/base.min.css");
@import url("https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css");

/* Define global CSS variables for consistency */
:root {
  --primary-color: #BFFF2D;
  --primary-hover: #a8e826;
  --dark-bg: #090b13;
  --dark-element: #090b13;
  --dark-element-alt: #2f2f2f;
  --text-light: #ffffff;
  --text-medium: #e0e0e0;
  --text-dark: #000000;
  --input-bg: #ffffff;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
}

/* Custom styles for dark theme */
body {
  background-color: var(--dark-bg);
  color: var(--text-light);
}

.bg-gray-100 {
  background-color: var(--dark-bg);
}

.text-gray-900 {
  color: var(--text-medium);
}

.bg-zinc-900 {
  background-color: var(--dark-element-alt);
}

.text-black {
  color: var(--text-dark);
}

.text-gray-600 {
  color: #232323;
}

/* Primary color text and border styles */
.text-green-500 {
  color: var(--primary-color);
}

.border-green-500 {
  border-color: var(--primary-color);
}

.text-white {
  --tw-text-opacity: 1;
  color: rgb(255, 255, 255);
}

/* Form element styles - UPDATED for consistency */
input, 
select, 
textarea,
option {
  color: var(--text-dark);
  background-color: var(--input-bg);
  border: 1px solid rgba(156, 163, 175, 0.6);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  opacity: 1;
  width: 100%;
}

/* Focus state for all form elements - UPDATED for consistency */
input:focus, 
select:focus, 
textarea:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(191, 255, 45, 0.3) !important;
  --tw-ring-color: var(--primary-color) !important;
  --tw-ring-offset-shadow: none !important;
  --tw-ring-shadow: none !important;
}

/* Make sure focus-visible has the same styling */
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(191, 255, 45, 0.3) !important;
  --tw-ring-color: var(--primary-color) !important;
}

/* Hover state for form elements */
input:hover, 
select:hover, 
textarea:hover {
  border-color: rgba(156, 163, 175, 0.9);
}

/* Disabled form element state */
input:disabled, 
select:disabled, 
textarea:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Select options styling */
select option {
  padding: 0.5rem;
}

select option:checked {
  background-color: var(--primary-color);
  color: var(--text-light);
}

/* Style checkboxes and radio buttons */
[type="checkbox"], 
[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
}

[type="checkbox"]:checked, 
[type="radio"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Ring focus overrides */
.focus\:ring-2:focus {
  --tw-ring-color: var(--primary-color) !important;
}

.focus\:border-blue-500:focus {
  border-color: var(--primary-color) !important;
}

/* Button styling with updated colors */
.bg-blue-500 {
  background-color: #3498db;
}

.hover\:bg-blue-700:hover {
  background-color: #2980b9;
}

.bg-green-500 {
  background-color: var(--primary-color);
}

.hover\:bg-green-700:hover {
  background-color: var(--primary-hover);
}

.bg-red-500 {
  background-color: var(--danger);
}

.hover\:bg-red-700:hover {
  background-color: var(--danger-hover);
}

/* Customizable button and tab title colors */
.button-text {
  color: var(--text-light) !important;
}

.tab-title {
  color: var(--text-medium);
}

/* Dashboard styles */
.dashboard-item {
  background-color: var(--dark-element);
  color: var(--text-light);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.dashboard-item p {
  font-size: 2rem;
  font-weight: bold;
}

.dashboard-blue { background-color: #3498db; }
.dashboard-green { background-color: #dee12c; }
.dashboard-yellow { background-color: #f1c40f; }
.dashboard-purple { background-color: #9b59b6; }
.dashboard-red { background-color: var(--danger); }
.dashboard-indigo { background-color: #34495e; }

.card-hover:hover {
  border-color: var(--primary-color) !important;
}

/* Table Header Style */
table thead {
  background-color: var(--dark-element-alt);
  color: #f5f5f5;
  text-transform: uppercase;
}

table thead th {
  padding: 12px;
  border: 1px solid #444;
}

/* Table Body Style */
table tbody tr {
  transition: background-color 0.3s ease;
}

table tbody tr:hover {
  background-color: var(--dark-element);
}

table tbody td {
  padding: 12px;
  border: 1px solid #444;
}

/* General Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  text-align: left;
}

/* Category Table Search Input */
#searchInput {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 16px;
  width: 100%;
}

/* General Transition Effects for Hover */
.transition {
  transition: all 0.3s ease;
}

.hover\:bg-gray-700:hover {
  background-color: #333333;
}

/* Borders */
.border {
  border: 1px solid #444;
}

.border-mobilem {
  border: 1px solid var(--primary-color);
}

.hover\:border-mobilem:hover {
  border: 1px solid var(--primary-color);
}

/* Ajustar el contenedor principal */
.container {
  z-index: 1 !important;
}

/* Asegurarse que el menú móvil esté por encima de todo */
#mobile-menu {
  z-index: 999999 !important;
}

/* Make sure desktop nav is visible and properly aligned */
.desktop-nav {
  display: flex !important;
  align-items: center;
}

/* Ensure desktop nav is visible on medium screens and up */
@media (min-width: 768px) {
  .hidden.md\:block {
    display: block !important;
  }
}

/* Fix text contrast issues */
.desktop-nav a {
  color: var(--text-light);
  font-weight: 500;
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  transition: background-color 0.3s;
}

.desktop-nav a:hover {
  background-color: rgba(75, 85, 99, 0.4);
}

/* Style active link */
.desktop-nav a.active {
  background-color: var(--primary-color);
  color: white;
}

/* Enhanced desktop navigation */
.desktop-nav {
  display: flex;
  align-items: center;
}

.desktop-nav ul {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0;
  margin: 0;
}

.desktop-nav li {
  list-style: none;
}

/* Basic nav link styling */
.desktop-nav a {
  display: inline-block;
  padding: 10px 16px;
  color: var(--text-light);
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

/* Hover effect */
.desktop-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Active link state */
.desktop-nav a.active,
.desktop-nav a[aria-current="page"] {
  background-color: rgba(191, 255, 45, 0.2);
  color: var(--primary-color);
}

/* Special styling for action buttons */
.desktop-nav a.nav-btn {
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.desktop-nav a.btn-primary {
  background-color: var(--primary-color);
  color: black;
}

.desktop-nav a.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.desktop-nav a.btn-danger {
  background-color: var(--danger);
  color: white;
}

.desktop-nav a.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .desktop-nav a {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  .desktop-nav ul {
    gap: 4px;
  }
  
  .desktop-nav a {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

/* Header and Navigation Styles */
.nav-link {
  display: inline-block;
  padding: 0.625rem 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95rem;
}

.nav-link:hover {
  background-color: rgba(191, 255, 45, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  background-color: rgba(191, 255, 45, 0.15);
  color: var(--primary-color);
}

.nav-btn {
  display: inline-block;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

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

.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-2px);
}

/* Mobile Navigation Styles */
.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-medium);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  background-color: rgba(191, 255, 45, 0.1);
  color: var(--primary-color);
}

.mobile-nav-btn-primary, .mobile-nav-btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  margin: 0 0.5rem;
}

.mobile-nav-btn-primary {
  background-color: var(--primary-color);
  color: black;
}

.mobile-nav-btn-primary:hover {
  background-color: var(--primary-hover);
}

.mobile-nav-btn-danger {
  background-color: var(--danger);
  color: white;
}

.mobile-nav-btn-danger:hover {
  background-color: var(--danger-hover);
}

/* Mobile Menu Animation */
#mobile-menu.hidden {
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  pointer-events: none;
}

#mobile-menu {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Consistent dropdown styling */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23BFFF2D' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Cookie Banner Container */
#cookieConsent {
  background-color: var(--dark-element);
  border-top: 2px solid var(--primary-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
}

/* Main Banner Layout */
#cookieMainBanner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Banner Title */
#cookieConsent h3 {
  color: var(--text-light);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Banner Description */
#cookieConsent p {
  color: var(--text-medium);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Cookie Settings Button */
#cookieSettingsBtn {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

#cookieSettingsBtn:hover {
  background-color: rgba(191, 255, 45, 0.1);
  border-color: rgba(191, 255, 45, 0.2);
  transform: translateY(-1px);
}

/* Accept All Cookies Button */
#acceptAllCookies {
  background-color: var(--primary-color);
  color: var(--text-dark); /* Changed from white to text-dark (black) */
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: none;
}

#acceptAllCookies:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Accept Essential Cookies Button */
#acceptEssentialCookies {
  background-color: var(--dark-element-alt);
  color: var(--text-medium);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#acceptEssentialCookies:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* Settings Panel */
#cookieSettings {
  max-width: 1200px;
  margin: 0 auto;
}

/* Cookie Types Cards */
#cookieSettings .bg-zinc-800 {
  background-color: rgba(45, 45, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

#cookieSettings .bg-zinc-800:hover {
  background-color: rgba(50, 50, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Custom Checkboxes */
#cookieSettings input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(156, 163, 175, 0.6);
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: var(--dark-element);
  margin-right: 0.5rem;
  vertical-align: middle;
}

#cookieSettings input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

#cookieSettings input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(191, 255, 45, 0.3);
}

/* Custom checkmark for checkbox */
#cookieSettings input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.2rem;
  width: 0.35rem;
  height: 0.65rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Disabled Checkbox */
#cookieSettings input[type="checkbox"]:disabled {
  background-color: rgba(156, 163, 175, 0.2);
  border-color: rgba(156, 163, 175, 0.3);
  cursor: not-allowed;
}

#cookieSettings input[type="checkbox"]:disabled:checked {
  background-color: rgba(191, 255, 45, 0.5);
}

/* Left Border Accent for Cookie Types */
#cookieSettings .flex-1 {
  position: relative;
  padding-left: 0.75rem;
}

#cookieSettings .flex-1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* Save Preferences Button */
#savePreferences {
  background-color: var(--primary-color);
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: none;
}

#savePreferences:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Back Button */
#backToMain {
  background-color: var(--dark-element-alt);
  color: var(--text-medium);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#backToMain:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* Transition Animations */
#cookieMainBanner, #cookieSettings {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#cookieMainBanner.hidden, #cookieSettings.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Cookie Type Labels */
#cookieSettings .font-medium {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Cookie Type Descriptions */
#cookieSettings .text-gray-400 {
  font-size: 0.85rem;
  color: rgba(224, 224, 224, 0.6);
  margin-top: 0.375rem;
  margin-left: 1.75rem;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  #cookieConsent {
    padding: 1.25rem;
  }
  
  #cookieConsent h3 {
    font-size: 1.125rem;
  }
  
  #cookieConsent p {
    font-size: 0.85rem;
  }
  
  #cookieSettingsBtn,
  #acceptAllCookies,
  #acceptEssentialCookies,
  #savePreferences,
  #backToMain {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  #cookieSettings .p-4 {
    padding: 0.75rem;
  }
}