/* ShowData.io Custom Styles */

/* Accessibility: Links must be distinguishable without relying only on color */
/* Add underlines to content links (not nav/buttons) */
main a:not([class*="bg-"]):not([class*="border-"]):not([class*="rounded"]) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

main a:not([class*="bg-"]):not([class*="border-"]):not([class*="rounded"]):hover {
    text-decoration-thickness: 2px;
}

/* Footer links - underline on hover is ok since they're in a distinct area */
footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile menu - using details/summary */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::marker {
    display: none;
}

/* Base form elements - Tailwind forms styling */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chart container sizing */
.chart-container {
    position: relative;
    width: 100%;
}

/* Map styling */
#destinationMap {
    z-index: 1;
}

/* Table improvements */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .stat-card .text-3xl {
        font-size: 1.5rem;
    }

    /* Reduce padding on small screens */
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Ensure tables scroll horizontally */
    table {
        min-width: 600px;
    }

    /* Stack pagination on mobile */
    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Smaller text on mobile for dense content */
    .text-sm {
        font-size: 0.8125rem;
    }

    /* Better touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Make cards full-width on mobile */
    .grid {
        gap: 1rem;
    }

    /* Footer columns on mobile */
    footer .grid {
        text-align: center;
    }
}

/* Prevent horizontal overflow on body */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure scrollable containers work well */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Table mobile improvements */
@media (max-width: 768px) {
    th, td {
        padding: 0.5rem 0.75rem;
    }

    /* Hide less important columns on medium screens */
    .hide-mobile {
        display: none;
    }
}

/* Print styles */
@media print {
    nav, footer {
        display: none;
    }

    .bg-white {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
