/**
 * Custom CSS for Vietlott Prediction System
 * Extends Tailwind CSS with custom styles and lottery-specific components
 */

/* Custom CSS Variables */
:root {
    --primary-blue: #2563eb;
    --primary-red: #ef4444;
    --primary-green: #22c55e;
    --primary-purple: #9333ea;
    --jackpot-red: #dc2626;
    --success-green: #16a34a;
    --warning-yellow: #eab308;
    --error-red: #dc2626;
}

/* Logo Styles */
.vietlott-logo {
    filter: brightness(0) invert(1);
    /* Make logo white on blue background */
    transition: all 0.3s ease;
    object-fit: contain;
    display: block;
}

.vietlott-logo:hover {
    filter: brightness(0) invert(1) opacity(0.8);
}

/* Ensure logo doesn't break on very small screens */
@media (max-width: 320px) {
    .header-logo-container img {
        height: 20px;
        min-height: 20px;
    }
}

/* Logo Link Styles */
.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Header Logo Container */
.header-logo-container {
    display: flex;
    align-items: center;
}

.header-logo-container img {
    height: 24px;
    width: auto;
    max-width: 100%;
}

/* Small devices (phones) */
@media (min-width: 480px) {
    .header-logo-container img {
        height: 28px;
    }
}

/* Medium devices (tablets) */
@media (min-width: 768px) {
    .header-logo-container img {
        height: 32px;
    }
}

/* Large devices (desktops) */
@media (min-width: 1024px) {
    .header-logo-container img {
        height: 36px;
    }
}

/* Extra large devices */
@media (min-width: 1280px) {
    .header-logo-container img {
        height: 40px;
    }
}

/* iPad specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-logo-container img {
        height: 30px;
    }
}

/* iPad Pro and large tablets */
@media (min-width: 1024px) and (max-width: 1366px) {
    .header-logo-container img {
        height: 34px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .vietlott-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

body {
    font-family: 'Inter', 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Lottery Number Styles */
.lottery-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    margin: 2px;
    transition: all 0.3s ease;
}

.regular-number {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
    font-weight: 600;
}

.jackpot-number {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--jackpot-red);
    border: 2px solid var(--jackpot-red);
    font-weight: 900;
    animation: jackpot-pulse 2s infinite;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
}

@keyframes jackpot-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
    }
}

/* Bonus Number Styles */
.lotto-bonus-number {
    background: #22c55e !important;
    /* Green background for Lotto 5/35 */
    color: white !important;
    border: 2px solid #16a34a !important;
    font-weight: 700 !important;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
}

.power-bonus-number {
    background: #ef4444 !important;
    /* Red background for Power 6/55 */
    color: white !important;
    border: 2px solid #dc2626 !important;
    font-weight: 700 !important;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
}

/* Jackpot Winner Row Background */
.bg-red-25 {
    background-color: rgba(254, 242, 242, 0.8) !important;
}

tr.bg-red-25:hover {
    background-color: rgba(254, 226, 226, 0.9) !important;
}

/* Hot/Cold Number Indicators */
.hot-number {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.cold-number {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.warm-number {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    color: var(--warning-yellow);
    border: 2px solid var(--warning-yellow);
}

/* Prediction Number Styles */
.prediction-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    margin: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.prediction-number:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.primary-prediction {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.alternative-prediction {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Confidence Indicators */
.confidence-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.confidence-high {
    background: linear-gradient(90deg, var(--success-green) 0%, #22c55e 100%);
}

.confidence-medium {
    background: linear-gradient(90deg, var(--warning-yellow) 0%, #eab308 100%);
}

.confidence-low {
    background: linear-gradient(90deg, var(--error-red) 0%, #dc2626 100%);
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin: 20px 0;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Data Tables */
.lottery-table {
    width: 100%;
    min-width: 700px;
    /* Reduced minimum width for better mobile display */
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
    /* Fixed layout for consistent column widths */
}

.lottery-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    /* Prevent header text wrapping */
}

.lottery-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    white-space: nowrap;
    /* Prevent cell content wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific column widths - optimized for no horizontal scroll */
.lottery-table th:nth-child(1),
.lottery-table td:nth-child(1) {
    width: 120px;
    /* Date column - reduced */
    min-width: 120px;
}

.lottery-table th:nth-child(2),
.lottery-table td:nth-child(2) {
    width: 320px;
    /* Numbers column - reduced but still readable */
    min-width: 320px;
}

.lottery-table th:nth-child(3),
.lottery-table td:nth-child(3) {
    width: 220px;
    /* Jackpot column - slightly reduced */
    min-width: 220px;
}

.lottery-table tr:hover {
    background: #f9fafb;
}

/* Table container with max height and scroll */
.table-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    /* Allow horizontal scroll if needed */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Full width table container - allow horizontal scroll on mobile */
.table-container-full {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    /* Allow horizontal scroll */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 100%;
}

/* Mobile specific table container adjustments */
@media (max-width: 768px) {
    .table-container-full {
        overflow-x: auto;
        /* Ensure horizontal scroll on mobile */
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Full width table styles */
.lottery-table-full {
    width: 100%;
    min-width: 600px;
    /* Ensure minimum width for all columns */
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    table-layout: fixed;
    /* Fixed layout for consistent column widths */
}

.lottery-table-full th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.lottery-table-full td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    word-wrap: break-word;
    /* Allow text wrapping for long content */
    overflow-wrap: break-word;
}

/* Optimized column widths for full display */
.lottery-table-full th:nth-child(1),
.lottery-table-full td:nth-child(1) {
    width: 25%;
    /* Date column - increased for mobile */
    min-width: 120px;
}

.lottery-table-full th:nth-child(2),
.lottery-table-full td:nth-child(2) {
    width: 45%;
    /* Numbers column */
    min-width: 250px;
}

.lottery-table-full th:nth-child(3),
.lottery-table-full td:nth-child(3) {
    width: 30%;
    /* Jackpot column */
    min-width: 150px;
}

.lottery-table-full tr:hover {
    background: #f9fafb;
}

/* FORCE TABLE TEXT COLOR - Fix for mobile/iPad white text issue */
.lottery-table-full th,
.lottery-table-full td {
    color: #000000 !important;
    /* Force black text */
    -webkit-text-fill-color: #000000 !important;
    /* iOS Safari fix */
    background-color: transparent !important;
    /* Ensure no background interference */
}

/* Specific fix for date column */
.lottery-table-full th:nth-child(1),
.lottery-table-full td:nth-child(1) {
    color: #000000 !important;
    /* Force black text for date column */
    -webkit-text-fill-color: #000000 !important;
}

/* Mobile/iPad specific table text fixes */
@media (max-width: 1024px) {

    .lottery-table-full th,
    .lottery-table-full td,
    .lottery-table-full th *,
    .lottery-table-full td *,
    .lottery-table-full span,
    .lottery-table-full div {
        color: #000000 !important;
        /* Strong black text for mobile/iPad */
        -webkit-text-fill-color: #000000 !important;
        /* iOS Safari fix */
        background-color: transparent !important;
        opacity: 1 !important;
    }

    /* Hover state fix for mobile */
    .lottery-table-full tr:hover td {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }
}

/* Scrollbar styles for full table container */
.table-container-full::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    /* Add horizontal scrollbar height */
}

.table-container-full::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container-full::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container-full::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile scrollbar styling */
@media (max-width: 768px) {
    .table-container-full::-webkit-scrollbar {
        width: 6px;
        height: 6px;
        /* Smaller scrollbar on mobile */
    }

    .table-container-full::-webkit-scrollbar-thumb {
        background: #9ca3af;
        border-radius: 3px;
    }
}

/* Lottery Type Cards */
.lottery-card {
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.lottery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.lottery-card.selected {
    border-color: var(--primary-blue);
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.lottery-card-power {
    border-color: var(--primary-red);
}

.lottery-card-lotto {
    border-color: var(--primary-green);
}

.lottery-card-mega {
    border-color: var(--primary-purple);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: var(--success-green);
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.4);
}

.status-offline {
    background: var(--error-red);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.4);
}

.status-warning {
    background: var(--warning-yellow);
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

/* Loading Animations */
.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, #3b82f6 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: var(--success-green);
    color: #166534;
}

.alert-warning {
    background: #fefce8;
    border-color: var(--warning-yellow);
    color: #854d0e;
}

.alert-error {
    background: #fef2f2;
    border-color: var(--error-red);
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--primary-blue);
    color: #1e40af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lottery-number {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 12px;
    }

    .prediction-number {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 14px;
    }

    .chart-container {
        height: 250px;
    }

    .lottery-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .lottery-number {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 11px;
        margin: 1px;
    }

    .prediction-number {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
        margin: 2px;
    }

    .chart-container {
        height: 200px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .lottery-number,
    .prediction-number {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }

    .chart-container {
        height: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }

    body {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .lottery-card {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .lottery-table th {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Input Field Fixes - Universal for all pages */
input,
select,
textarea {
    color: #000000 !important;
    /* Force black text for all inputs */
    background-color: #ffffff !important;
    /* Force white background */
    -webkit-text-fill-color: #000000 !important;
    /* iOS Safari fix */
    opacity: 1 !important;
    /* Ensure full opacity */
    -webkit-appearance: none !important;
    /* Remove iOS styling */
    appearance: none !important;
}

/* Specific input type fixes */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="radio"],
input[type="checkbox"],
select,
textarea {
    color: #000000 !important;
    /* Strong black text */
    background-color: #ffffff !important;
    /* White background */
    -webkit-text-fill-color: #000000 !important;
    /* iOS Safari fix */
    opacity: 1 !important;
    border: 1px solid #d1d5db !important;
    /* Ensure visible border */
    padding: 8px 12px !important;
    /* Consistent padding */
    border-radius: 6px !important;
    /* Rounded corners */
    font-size: 14px !important;
    /* Readable font size */
    box-shadow: none !important;
    /* Remove any conflicting shadows */
}

/* Radio and checkbox specific styling */
input[type="radio"],
input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
}

/* Mobile input fixes - Enhanced */
@media (max-width: 768px) {

    input,
    select,
    textarea {
        color: #000000 !important;
        /* Even stronger black text for mobile */
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
        -webkit-appearance: none !important;
        /* Remove iOS default styling */
        appearance: none !important;
        font-size: 16px !important;
        /* Prevent zoom on iOS */
        padding: 12px 16px !important;
        border: 2px solid #d1d5db !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        /* Remove any shadow that might interfere */
    }

    /* Specific mobile fixes for all input types */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        color: #000000 !important;
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
        -webkit-opacity: 1 !important;
        opacity: 1 !important;
    }

    /* Radio and checkbox mobile adjustments */
    input[type="radio"],
    input[type="checkbox"] {
        font-size: 14px !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
    }

    /* Placeholder text color */
    input::placeholder,
    textarea::placeholder {
        color: #6b7280 !important;
        opacity: 1 !important;
        -webkit-text-fill-color: #6b7280 !important;
    }

    /* Focus state for mobile */
    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--primary-blue) !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
        outline: none !important;
    }

    /* Active state */
    input:active,
    select:active,
    textarea:active {
        color: #000000 !important;
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
    }

    /* Disabled state */
    input:disabled,
    select:disabled,
    textarea:disabled {
        color: #6b7280 !important;
        background-color: #f3f4f6 !important;
        -webkit-text-fill-color: #6b7280 !important;
        opacity: 0.6 !important;
    }
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {

    input,
    select,
    textarea {
        -webkit-appearance: none !important;
        -webkit-text-fill-color: #000000 !important;
        color: #000000 !important;
        background-color: #ffffff !important;
    }
}

/* Dark mode override - ensure inputs stay readable */
@media (prefers-color-scheme: dark) {

    input,
    select,
    textarea {
        color: #000000 !important;
        /* Keep black text even in dark mode */
        background-color: #ffffff !important;
        /* Keep white background */
        -webkit-text-fill-color: #000000 !important;
    }
}

/* Mobile Menu Styles */
.mobile-menu-transition {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    header {
        position: sticky;
        top: 0;
        z-index: 50;
    }

    /* Ensure mobile menu is above content */
    #mobileMenu {
        position: relative;
        z-index: 51;
        background: rgba(37, 99, 235, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Mobile menu items styling */
    #mobileMenu a,
    #mobileMenu button {
        font-size: 16px;
        font-weight: 500;
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(5px);
        transition: all 0.2s ease;
    }

    #mobileMenu a:hover,
    #mobileMenu button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    /* Header title responsive */
    h1 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    /* Mobile menu button animation */
    #mobileMenuBtn {
        transition: all 0.2s ease;
    }

    #mobileMenuBtn:hover {
        transform: scale(1.05);
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    h1 {
        font-size: 2rem !important;
    }

    nav a,
    nav button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {

    .lottery-number,
    .prediction-number {
        border-width: 3px !important;
    }

    .jackpot-number {
        background: #ffffff !important;
        color: #000000 !important;
        border-color: #000000 !important;
    }

    #mobileMenu {
        background: #ffffff !important;
        color: #000000 !important;
    }

    #mobileMenu a,
    #mobileMenu button {
        border: 2px solid #000000 !important;
        color: #000000 !important;
    }
}

/* Animation Preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ULTIMATE INPUT FIXES - FOR ALL DEVICES INCLUDING IPAD */
/* This section uses the strongest possible CSS selectors to override any conflicting styles */

/* Universal input selector with maximum specificity */
input,
input[class],
input[id],
select,
select[class],
select[id],
textarea,
textarea[class],
textarea[id],
.form-control,
.form-input,
.input,
input.form-control,
input.form-input,
input.input,
select.form-control,
select.form-input,
select.input,
textarea.form-control,
textarea.form-input,
textarea.input {
    color: #000000 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
    -webkit-background-clip: padding-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    -webkit-opacity: 1 !important;
    /* iPad specific fixes */
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: default !important;
}

/* iPad and large tablet specific fixes */
@media (min-width: 768px) and (max-width: 1024px) {

    input,
    select,
    textarea {
        color: #000000 !important;
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
        border: 2px solid #d1d5db !important;
        border-radius: 8px !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    /* Force override any Tailwind or framework classes */
    input.border-gray-300,
    input.border,
    select.border-gray-300,
    select.border,
    textarea.border-gray-300,
    textarea.border {
        color: #000000 !important;
        background-color: #ffffff !important;
        -webkit-text-fill-color: #000000 !important;
    }
}

/* Webkit/Safari specific fixes for all iOS devices */
@supports (-webkit-appearance: none) {

    input,
    select,
    textarea {
        -webkit-appearance: none !important;
        -webkit-text-fill-color: #000000 !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
}

/* Force override for any framework classes that might conflict */
.bg-white input,
.bg-white select,
.bg-white textarea,
input.bg-white,
select.bg-white,
textarea.bg-white,
.form-group input,
.form-group select,
.form-group textarea,
.input-group input,
.input-group select,
.input-group textarea {
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
}

/* Placeholder fixes for all devices */
input::placeholder,
textarea::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder,
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #6b7280 !important;
}

/* Focus state fixes */
input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
    border-color: var(--primary-blue) !important;
    outline: 2px solid var(--primary-blue) !important;
    outline-offset: 2px !important;
}

/* Modal text color fixes for mobile/iPad */
@media (max-width: 1024px) {

    /* Force black text in all modals */
    .fixed.inset-0.bg-black.bg-opacity-50 .bg-white,
    .fixed.inset-0.bg-black.bg-opacity-50 .bg-white *,
    .modal-content,
    .modal-content * {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }

    /* Specific modal text elements */
    .fixed.inset-0.bg-black.bg-opacity-50 .text-gray-700,
    .fixed.inset-0.bg-black.bg-opacity-50 .text-gray-600,
    .fixed.inset-0.bg-black.bg-opacity-50 .text-gray-500,
    .fixed.inset-0.bg-black.bg-opacity-50 .text-gray-400,
    .fixed.inset-0.bg-black.bg-opacity-50 .text-white,
    .fixed.inset-0.bg-black.bg-opacity-50 .opacity-75,
    .fixed.inset-0.bg-black.bg-opacity-50 .opacity-50 {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }

    /* Modal date and number text */
    .fixed.inset-0.bg-black.bg-opacity-50 .text-xs,
    .fixed.inset-0.bg-black.bg-opacity-50 .text-sm,
    .fixed.inset-0.bg-black.bg-opacity-50 .font-mono {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }

    /* Modal analysis results */
    .fixed.inset-0.bg-black.bg-opacity-50 .space-y-1,
    .fixed.inset-0.bg-black.bg-opacity-50 .space-y-1 * {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }
}