/* 
 * Crypto Exchange and Arbitrage Explorer Styles
 * Common CSS file for exchange.php and arbitrage_view.php
 */

/* Base Styles */
body {
    background-color: #f9fafb;  /* bg-gray-50 */
    color: #1f2937;  /* text-gray-800 */
}

/* Header & Footer Styles */
header {
    background-image: linear-gradient(to right, #2563eb, #4f46e5);  /* from-blue-600 to-indigo-700 */
    padding: 1rem 0;  /* py-4 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);  /* shadow-lg */
}

footer {
    background-color: #1f2937;  /* bg-gray-800 */
    color: #ffffff;  /* text-white */
    padding: 1.5rem 0;  /* py-6 */
    margin-top: 2rem;  /* mt-8 */
}

.hero-section {
    background-image: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #4f46e5 100%);
    position: relative;
    overflow: hidden;
  }
  
  .hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/pattern-dots.svg');
    opacity: 0.1;
  }

  .stat-card {
    transition: all 0.3s ease;
  }
  
  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #4f46e5;
  }

  h1 {
    letter-spacing: -0.025em;
    line-height: 1.1;
  }
  
  p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
  }

/* Content Container */
.container {
    max-width: 80rem;  /* max-w-7xl */
    margin: 0 auto;
    padding: 0 1rem;  /* px-4 */
}

main .container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;  /* py-6 */
}

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

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

.arbitrage-opportunity {
    transition: transform 0.2s ease-in-out;
}
.arbitrage-opportunity:hover {
    transform: translateY(-4px);
}
.highlight-pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Fix scrollbar issues */
.max-h-40 {
    max-height: 10rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.max-h-28 {
    max-height: 7rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Hide scrollbar when not needed */
.overflow-x-auto:not(:hover)::-webkit-scrollbar,
.overflow-y-auto:not(:hover)::-webkit-scrollbar {
    display: none;
}

/* Additional CSS for enhanced scrollbars - add to existing style section */
.scrollbar-thin {
    scrollbar-width: thin;
}

/* Custom scrollbar styling */
.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Add custom styling for form elements */
input[type="number"] {
    transition: all 0.2s ease-in-out;
}

input[type="number"]:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced button styles */
button {
    transition: all 0.2s ease-in-out;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Checkbox hover effect */
input[type="checkbox"] + label {
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked + label {
    color: #3182ce;
}

/* Gradient backgrounds for buttons */
.bg-gradient-to-r {
    background-size: 200% auto;
    transition: 0.3s;
}

.bg-gradient-to-r:hover {
    background-position: right center;
}

/* Card Styles */
.card {
    background-color: #ffffff;  /* bg-white */
    border-radius: 0.75rem;  /* rounded-xl */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);  /* shadow-md */
    padding: 1.5rem;  /* p-6 */
    margin-bottom: 2rem;  /* mb-8 */
}

.card-border {
    border: 1px solid #e5e7eb;  /* border border-gray-100 */
}

/* Exchange Cards */
.exchange-card {
    transition: transform 0.2s ease-in-out;
}

.exchange-card:hover {
    transform: translateY(-4px);
}

/* Arbitrage Cards */
.arbitrage-opportunity {
    transition: transform 0.2s ease-in-out;
}

.arbitrage-opportunity:hover {
    transform: translateY(-4px);
}

/* Stat Boxes */
.stat-box {
    padding: 1rem;  /* p-4 */
    border-radius: 0.5rem;  /* rounded-lg */
    border-width: 1px;  /* border */
}

.stat-box-blue {
    background-color: #eff6ff;  /* bg-blue-50 */
    border-color: #dbeafe;  /* border-blue-100 */
}

.stat-box-green {
    background-color: #ecfdf5;  /* bg-green-50 */
    border-color: #d1fae5;  /* border-green-100 */
}

.stat-box-purple {
    background-color: #f5f3ff;  /* bg-purple-50 */
    border-color: #ede9fe;  /* border-purple-100 */
}

.stat-box-yellow {
    background-color: #fffbeb;  /* bg-yellow-50 */
    border-color: #fef3c7;  /* border-yellow-100 */
}

/* Button Styles */
.quote-btn {
    transition: all 0.2s ease;
}

.quote-btn:hover {
    transform: translateY(-2px);
}

.btn {
    padding: 0.5rem 1rem;  /* px-4 py-2 */
    border-radius: 0.375rem;  /* rounded-md */
    transition: background-color 0.2s ease;
}

.btn-blue {
    background-color: #2563eb;  /* bg-blue-600 */
    color: #ffffff;  /* text-white */
}

.btn-blue:hover {
    background-color: #1d4ed8;  /* hover:bg-blue-700 */
}

.btn-green {
    background-color: #059669;  /* bg-green-600 */
    color: #ffffff;  /* text-white */
}

.btn-green:hover {
    background-color: #047857;  /* hover:bg-green-700 */
}

.btn-red {
    background-color: #dc2626;  /* bg-red-600 */
    color: #ffffff;  /* text-white */
}

.btn-red:hover {
    background-color: #b91c1c;  /* hover:bg-red-700 */
}


/* Filter Section */
.input-search {
    width: 100%;
    padding: 0.5rem 1rem;  /* px-4 py-2 */
    border: 1px solid #d1d5db;  /* border */
    border-radius: 0.375rem;  /* rounded-md */
}

.input-search:focus {
    outline: none;
    border-color: #3b82f6;  /* focus:border-blue-500 */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);  /* focus:ring-2 focus:ring-blue-500 */
}

/* Badges and Tags */
.badge {
    border-radius: 9999px;  /* rounded-full */
    padding: 0.125rem 0.5rem;  /* px-2 py-0.5 */
    font-size: 0.75rem;  /* text-xs */
    font-weight: 700;  /* font-bold */
}

.badge-green {
    background-color: #d1fae5;  /* bg-green-100 */
    color: #065f46;  /* text-green-800 */
}

.badge-blue {
    background-color: #dbeafe;  /* bg-blue-200 */
    color: #1e40af;  /* text-blue-800 */
}

.badge-yellow {
    background-color: #fef3c7;  /* bg-yellow-100 */
    color: #92400e;  /* text-yellow-800 */
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 0.5rem;  /* w-2 */
    height: 0.5rem;  /* h-2 */
    border-radius: 9999px;  /* rounded-full */
    margin-right: 0.25rem;  /* mr-1 */
}

.status-active {
    background-color: #10b981;  /* bg-green-500 */
}

.status-inactive {
    background-color: #ef4444;  /* bg-red-500 */
}

/* Tables */
.table-container {
    background-color: #f9fafb;  /* bg-gray-50 */
    border-radius: 0.5rem;  /* rounded-lg */
    overflow-x: auto;
}

table {
    min-width: 100%;
}

thead {
    background-color: #f3f4f6;  /* bg-gray-100 */
}

th {
    padding: 0.5rem 0.75rem;  /* py-2 px-3 */
    text-align: left;
    font-size: 0.75rem;  /* text-xs */
    font-weight: 500;  /* font-medium */
    text-transform: uppercase;
    color: #374151;  /* text-gray-700 */
    letter-spacing: 0.05em;  /* tracking-wider */
}

td {
    padding: 0.75rem;  /* py-3 px-3 */
    font-size: 0.875rem;  /* text-sm */
}

tbody tr {
    border-bottom: 1px solid #e5e7eb;  /* divide-y divide-gray-200 */
}

tbody tr:hover {
    background-color: #eff6ff;  /* hover:bg-blue-50 */
}

/* Alert boxes */
.alert {
    padding: 1rem;  /* p-4 */
    border-radius: 0.375rem;  /* rounded-md */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);  /* shadow-md */
    display: flex;
}

.alert-yellow {
    background-color: #fffbeb;  /* bg-yellow-50 */
    border-left-width: 4px;  /* border-l-4 */
    border-left-color: #fbbf24;  /* border-yellow-400 */
}

.alert-blue {
    background-color: #eff6ff;  /* bg-blue-50 */
    border-left-width: 4px;  /* border-l-4 */
    border-left-color: #60a5fa;  /* border-blue-400 */
}

/* Animation */
.highlight-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Gradients */
.gradient-blue {
    background-image: linear-gradient(to right, #2563eb, #4f46e5);  /* from-blue-600 to-indigo-700 */
}

.gradient-blue-light {
    background-image: linear-gradient(to bottom right, #ffffff, #eff6ff);  /* from-white to-blue-50 */
}

.gradient-green {
    background-image: linear-gradient(to right, #ecfdf5, #d1fae5);  /* from-green-50 to-green-100 */
}

.gradient-red {
    background-image: linear-gradient(to right, #fef2f2, #fee2e2);  /* from-red-50 to-red-100 */
}

.gradient-blue-bg {
    background-image: linear-gradient(to bottom right, #ffffff, #eff6ff);  /* from-white to-blue-50 */
}

/* Responsive Grid */
.grid-container {
    display: grid;
    gap: 1rem;  /* gap-4 */
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .grid-cols-md-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-cols-md-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .grid-cols-md-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

/* Flex Layouts */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

@media (min-width: 768px) {
    .md-flex-row {
        flex-direction: row;
    }
    
    .md\:items-center {
        align-items: center;
    }
    
    .md\:mb-0 {
        margin-bottom: 0;
    }
}

/* Typography */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Text colors */
.text-white {
    color: #ffffff;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-blue-400 {
    color: #60a5fa;
}

.text-blue-600 {
    color: #2563eb;
}

.text-blue-700 {
    color: #1d4ed8;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-600 {
    color: #059669;
}

.text-green-700 {
    color: #047857;
}

.text-green-800 {
    color: #065f46;
}

.text-red-500 {
    color: #ef4444;
}

.text-red-600 {
    color: #dc2626;
}

.text-red-700 {
    color: #b91c1c;
}

.text-red-800 {
    color: #991b1b;
}

.text-purple-700 {
    color: #7e22ce;
}

.text-yellow-700 {
    color: #b45309;
}

.text-yellow-800 {
    color: #92400e;
}

/* Links */
a.text-blue-400:hover {
    color: #93c5fd;  /* hover:text-blue-300 */
}

a.text-blue-600:hover {
    color: #1e40af;  /* hover:text-blue-800 */
}

/* Spacing */
.m-1 {
    margin: 0.25rem;
}

.mr-1 {
    margin-right: 0.25rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.mr-4 {
    margin-right: 1rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-1 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-full {
    border-radius: 9999px;
}

.w-full {
    width: 100%;
}

.h-4 {
    height: 1rem;
}

.h-5 {
    height: 1.25rem;
}

.h-6 {
    height: 1.5rem;
}

.h-8 {
    height: 2rem;
}

.h-10 {
    height: 2.5rem;
}

.w-2 {
    width: 0.5rem;
}

.w-4 {
    width: 1rem;
}

.w-5 {
    width: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.w-8 {
    width: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-auto {
    width: auto;
}

.max-h-28 {
    max-height: 7rem;
}

.max-h-40 {
    max-height: 10rem;
}

.h-64 {
    height: 16rem;
}

/* Positioning */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.-bottom-1 {
    bottom: -0.25rem;
}

.-right-1 {
    right: -0.25rem;
}

/* Transitions */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 0.2s;
}

.transition-shadow {
    transition-property: box-shadow;
    transition-duration: 0.2s;
}

/* Responsive width utilities */
@media (min-width: 768px) {
    .md\:w-1\/3 {
        width: 33.333333%;
    }
}

/* 
 * Styles for Arbitrage Explorer (arbitrage_view.php)
 * Added to integrate with the common styles.
 */

/* --- Filter Controls --- */
.filters-container {
    display: flex;
    flex-wrap: wrap; /* Allows filters to wrap on smaller screens */
    gap: 1.5rem; /* gap-6 */
    align-items: flex-end; /* Aligns inputs and labels nicely */
}

.filter-group {
    flex: 1 1 150px; /* Flex-grow, flex-shrink, flex-basis */
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #4b5563; /* text-gray-600 */
    margin-bottom: 0.25rem; /* mb-1 */
}

.filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem; /* py-2 px-3 */
    border: 1px solid #d1d5db; /* border border-gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    background-color: #ffffff; /* bg-white */
    transition: all 0.2s ease-in-out;
}

.filter-input:focus {
    outline: none;
    border-color: #3b82f6; /* focus:border-blue-500 */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); /* focus:ring-2 focus:ring-blue-300 */
}

.filter-input:disabled {
    background-color: #f3f4f6; /* bg-gray-100 */
    cursor: not-allowed;
}

/* Dropdown specific for Exchange filter */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff; /* bg-white */
    min-width: 200px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); /* shadow-lg */
    z-index: 10;
    border-radius: 0.5rem; /* rounded-lg */
    padding: 0.5rem; /* p-2 */
    margin-top: 0.25rem; /* mt-1 */
    border: 1px solid #e5e7eb; /* border border-gray-200 */
    max-height: 200px;
    overflow-y: auto;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content label {
    display: block;
    padding: 0.5rem 0.75rem; /* py-2 px-3 */
    cursor: pointer;
    border-radius: 0.375rem; /* rounded-md */
    transition: background-color 0.2s ease;
}

.dropdown-content label:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
}

/* --- Results Table --- */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}
.sortable-header:hover {
    background-color: #e5e7eb; /* hover:bg-gray-200 */
}

.price-up {
    color: #059669; /* text-green-600 */
    font-weight: 600; /* font-semibold */
}
.price-down {
    color: #dc2626; /* text-red-600 */
    font-weight: 600; /* font-semibold */
}

.highlight-spread {
    background-image: linear-gradient(to right, #ffffff, #ecfdf5); /* from-white to-green-50 */
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem; /* p-8 */
    min-height: 150px;
    font-size: 1rem; /* text-base */
    color: #6b7280; /* text-gray-500 */
}

.spinner {
  animation: rotate 2s linear infinite;
  width: 50px;
  height: 50px;
}
.spinner .path {
  stroke: #2563eb; /* blue-600 */
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
  100% { transform: rotate(360deg); }
}
@keyframes dash {
  0%   { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50%  { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}


/* --- Pagination --- */
.pagination-btn {
    padding: 0.5rem 1rem;  /* px-4 py-2 */
    border-radius: 0.375rem;  /* rounded-md */
    background-color: #2563eb;  /* bg-blue-600 */
    color: #ffffff;  /* text-white */
    font-weight: 500; /* font-medium */
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.pagination-btn:hover:not(:disabled) {
    background-color: #1d4ed8;  /* hover:bg-blue-700 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Remove default styles from Vue app wrapper */
#app[v-cloak] {
  display: block; /* Or your preferred display type */
}
[v-cloak] {
  display: none;
}


/* ── Mobile Menu: struttura flex (sempre attiva) ── */
.mobile-menu {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mobile-menu > nav {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
.mobile-menu > div:last-child {
    flex-shrink: 0;
}

/* ===================================================
   DARK MODE - prefers-color-scheme: dark
   Supporto dark mode per tutte le pagine ArbiMaster
   =================================================== */

@media (prefers-color-scheme: dark) {

    /* --- Base --- */
    html, body {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }

    /* --- Tailwind overrides: backgrounds --- */
    .bg-white {
        background-color: #1e293b !important;
    }
    .bg-gray-50 {
        background-color: #1a2332 !important;
    }
    .bg-gray-100 {
        background-color: #1e293b !important;
    }
    .bg-gray-200 {
        background-color: #2d3748 !important;
    }

    /* --- Tailwind overrides: text colors --- */
    .text-gray-900 {
        color: #f1f5f9 !important;
    }
    .text-gray-800 {
        color: #e2e8f0 !important;
    }
    .text-gray-700 {
        color: #cbd5e1 !important;
    }
    .text-gray-600 {
        color: #94a3b8 !important;
    }
    .text-gray-500 {
        color: #64748b !important;
    }
    .text-gray-400 {
        color: #94a3b8 !important;
    }
    .text-gray-300 {
        color: #64748b !important;
    }

    /* --- Prose / Article content (howto.php) --- */
    .prose,
    .prose p,
    .prose li,
    .prose ol,
    .prose ul,
    .prose blockquote {
        color: #cbd5e1 !important;
    }
    .prose h1,
    .prose h2,
    .prose h3,
    .prose h4,
    .prose h5,
    .prose h6 {
        color: #f1f5f9 !important;
    }
    .prose strong {
        color: #e2e8f0 !important;
    }
    .prose code {
        color: #a5b4fc !important;
        background-color: #1e293b !important;
    }
    .prose pre {
        background-color: #0f172a !important;
        border: 1px solid #334155 !important;
    }
    .prose a {
        color: #818cf8 !important;
    }
    .prose hr {
        border-color: #334155 !important;
    }
    .prose blockquote {
        border-left-color: #4f46e5 !important;
        background: #1e293b !important;
    }

    /* --- Cards e pannelli --- */
    .rounded-xl,
    .rounded-2xl,
    .rounded-lg {
        border-color: #334155 !important;
    }

    /* Shadow cards con bg bianco */
    [class*="shadow"] {
        box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
    }

    /* --- Tabelle --- */
    table {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
    }
    thead,
    .bg-gray-50 thead,
    thead.bg-gray-50 {
        background-color: #0f172a !important;
    }
    thead th,
    th {
        color: #94a3b8 !important;
        background-color: #0f172a !important;
        border-color: #334155 !important;
    }
    tbody tr {
        background-color: #1e293b !important;
        border-color: #334155 !important;
    }
    tbody tr:nth-child(even) {
        background-color: #1a2332 !important;
    }
    tbody tr:hover {
        background-color: #263349 !important;
    }
    td {
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }
    .divide-y > * {
        border-color: #334155 !important;
    }
    .divide-gray-200 > * {
        border-color: #334155 !important;
    }

    /* --- Borders --- */
    .border,
    .border-gray-100,
    .border-gray-200,
    .border-gray-300 {
        border-color: #334155 !important;
    }

    /* --- Form inputs --- */
    input,
    select,
    textarea {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
        border-color: #475569 !important;
    }
    input::placeholder,
    textarea::placeholder {
        color: #64748b !important;
    }
    input:focus,
    select:focus,
    textarea:focus {
        border-color: #667eea !important;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3) !important;
    }

    /* --- Labels --- */
    label {
        color: #cbd5e1 !important;
    }

    /* --- Buttons (non colorati) --- */
    .bg-white button,
    button.bg-white {
        background-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    /* --- Header navigation --- */
    .header-backdrop {
        background: rgba(15, 23, 42, 0.97) !important;
        border-bottom: 1px solid rgba(51, 65, 85, 0.8) !important;
    }
    .mobile-menu {
        background: rgba(15, 23, 42, 0.98) !important;
    }
    .mobile-nav-link {
        color: #cbd5e1 !important;
    }
    .mobile-nav-link:hover {
        background: rgba(102, 126, 234, 0.15) !important;
        color: #a5b4fc !important;
    }
    .hamburger span {
        background: #e2e8f0 !important;
    }

    /* --- Footer --- */
    footer {
        background-color: #0a0f1e !important;
    }

    /* --- Specifico: about / howto page con main bg-white --- */
    main.bg-white {
        background-color: #0f172a !important;
    }

    /* --- Specifico: stat cards --- */
    .stat-card {
        background-color: #1e293b !important;
        border-color: #334155 !important;
    }

    /* --- Arbitrage table spreads colori ok già colorati (verde/rosso) --- */
    /* I valori positivi/negativi mantengono i loro colori */
    .text-green-600 { color: #34d399 !important; }
    .text-green-700 { color: #10b981 !important; }
    .text-red-600   { color: #f87171 !important; }
    .text-red-500   { color: #fc8181 !important; }

    /* --- Badge / pills --- */
    .bg-green-100 {
        background-color: #064e3b !important;
        color: #6ee7b7 !important;
    }
    .bg-red-100 {
        background-color: #7f1d1d !important;
        color: #fca5a5 !important;
    }
    .bg-blue-100 {
        background-color: #1e3a5f !important;
        color: #93c5fd !important;
    }
    .bg-yellow-100 {
        background-color: #451a03 !important;
        color: #fcd34d !important;
    }
    .bg-purple-100 {
        background-color: #3b0764 !important;
        color: #c4b5fd !important;
    }
    .text-green-800  { color: #6ee7b7 !important; }
    .text-red-800    { color: #fca5a5 !important; }
    .text-blue-800   { color: #93c5fd !important; }
    .text-yellow-800 { color: #fcd34d !important; }
    .text-purple-800 { color: #c4b5fd !important; }
    .text-blue-700   { color: #60a5fa !important; }
    .text-purple-700 { color: #a78bfa !important; }
    .text-yellow-700 { color: #fbbf24 !important; }

    /* --- Dropdown menus --- */
    #user-dropdown {
        background-color: #1e293b !important;
        border-color: #334155 !important;
    }
    #user-dropdown a {
        color: #cbd5e1 !important;
    }
    #user-dropdown a:hover {
        background-color: #263349 !important;
        color: #e2e8f0 !important;
    }

    /* --- Contact page --- */
    .contact-section,
    .contact-form {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    /* --- Spread sniper / simple arbitrage tabelle inline --- */
    .highlight-spread {
        background-color: #064e3b !important;
        color: #34d399 !important;
    }

    /* --- Mobile menu footer --- */
    .mobile-menu .border-t {
        border-color: #334155 !important;
    }
    .mobile-menu .bg-gray-50 {
        background-color: #1a2332 !important;
    }

    /* --- Scrollbar --- */
    ::-webkit-scrollbar-track {
        background: #1e293b !important;
    }
    ::-webkit-scrollbar-thumb {
        background: #475569 !important;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #64748b !important;
    }

    /* --- Sezioni con bg chiaro esplicito inline --- */
    [style*="background-color: #fff"],
    [style*="background: white"],
    [style*="background: #fff"],
    [style*="background:#fff"] {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
    }
    [style*="color: #333"],
    [style*="color:#333"],
    [style*="color: black"],
    [style*="color:#000"] {
        color: #e2e8f0 !important;
    }
}

/* ── html.dark: mobile menu (attivato dal toggle JS) ── */
html.dark .mobile-menu {
    background: rgba(15, 23, 42, 0.98) !important;
}
html.dark .mobile-nav-link {
    color: #cbd5e1 !important;
}
html.dark .mobile-nav-link:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    color: #a5b4fc !important;
}
html.dark .mobile-menu .border-t {
    border-color: #334155 !important;
}
html.dark .mobile-menu .bg-gray-50 {
    background-color: #1a2332 !important;
}
html.dark .header-backdrop {
    background: rgba(15, 23, 42, 0.97) !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.8) !important;
}
html.dark .hamburger span {
    background: #e2e8f0 !important;
}
html.dark body {
    background-color: #0f172a;
    color: #e2e8f0;
}
