/* Charts Page Styles */
.charts-container {
    min-height: calc(100vh - 200px);
}

/* Custom Select Styles */
select {
    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;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease-in-out;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Chart Container */
#chartContainer {
    min-height: 400px;
    position: relative;
}

#chartWrapper {
    position: relative;
    height: 500px;
}

/* Responsive Chart */
#priceChart {
    max-width: 100%;
    height: auto !important;
}

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

.info-card:hover {
    transform: translateY(-2px);
}

/* Custom Scrollbar for Mobile */
@media (max-width: 768px) {
    .charts-container {
        padding: 1rem;
    }
    
    .grid {
        gap: 1rem;
    }
    
    #chartWrapper {
        height: 350px;
    }
}

/* State Transitions */
.state-transition {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.state-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.state-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Chart Legend Styles */
.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Tooltip Styles */
.chart-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Error and Success Messages */
.message-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.message-error {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Period Buttons Alternative Style */
.period-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.period-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.period-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    .flex-col {
        flex-direction: column;
    }
    
    .sm\:flex-row {
        flex-direction: row;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
    
    .period-buttons {
        justify-content: center;
    }
    
    .period-btn {
        flex: 1;
        text-align: center;
        min-width: 60px;
    }
}

/* Print Styles */
@media print {
    .charts-container {
        background: white;
    }
    
    button {
        display: none;
    }
    
    #chartWrapper {
        page-break-inside: avoid;
    }
}