/**
 * Custom Styles
 * Additional styling and polish beyond Tailwind CSS
 */

/* Smooth transitions for all interactive elements */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0e27;
}

::-webkit-scrollbar-thumb {
    background: #2d3656;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d4668;
}

/* Modal backdrop blur effect */
#tradeModal {
    backdrop-filter: blur(4px);
}

/* Card hover effects */
.bg-dark-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-dark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button active state */
button:active {
    transform: scale(0.98);
}

/* Input focus glow */
input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Number input arrows styling for dark theme */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation for modal */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#tradeModal > div {
    animation: fadeIn 0.2s ease-out;
}

/* Filter button active state enhancement */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.filter-btn.bg-blue-600::after {
    transform: scaleX(1);
}

/* Gradient text for main title */
header h1 {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Statistics card number emphasis */
.text-3xl {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Chart container improvements */
canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #timeFilters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1 1 auto;
        min-width: fit-content;
    }
}

/* Print styles (for future export feature) */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .bg-dark-card {
        background: white;
        border: 1px solid #e5e7eb;
    }
    
    button {
        display: none;
    }
}

/* 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-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Notification slide-in animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Selection styling */
::selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: #f1f5f9;
}

/* Prevent text selection on UI elements */
button,
.filter-btn,
header {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* Loading skeleton (for future use) */
.skeleton {
    background: linear-gradient(
        90deg,
        #1e293b 0%,
        #334155 50%,
        #1e293b 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
/* Tab switching */
.tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Calendar styles */
#calendarGrid {
    gap: 8px;
}

#calendarGrid > div {
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

#calendarGrid > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Input range slider */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b82f6 0%, #3b82f6 50%, #374151 50%, #374151 100%);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    width: 24px;
    height: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    width: 24px;
    height: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

input[type="range"]::-moz-range-track {
    background: transparent;
    border: none;
}

/* Calendar day cells - smooth animations */
.calendar-day {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-day:hover {
    transform: scale(1.05);
}