/* Market Analysis CSS - Dashboard Style */

/* Overall Layout */
.market-analysis-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Tab styling */
.tab-button {
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #1e40af; /* Darker blue */
    border-color: #1e40af;
}

.tab-button:hover:not(.active) {
    color: #3b82f6;
    border-color: #93c5fd;
}

/* Chart container styling */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Card styling */
.card {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e3a8a;
}

.card-body {
    padding: 1.5rem;
}

/* Table styling */
.market-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.market-table th {
    position: sticky;
    top: 0;
    background-color: #f9fafb;
    z-index: 10;
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #1e293b;
    border-bottom: 2px solid #e5e7eb;
}

.market-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.market-table tr:hover td {
    background-color: #f3f4f6;
    transition: background-color 0.15s ease;
}

/* Dashboard cards */
.dashboard-cards .card {
    height: 100%;
    transition: all 0.3s ease;
}

.dashboard-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Pagination styling */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-top: 1rem;
}

.page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-button.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-button:not(.active):hover {
    background-color: #eff6ff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .market-data-card {
        margin-bottom: 1rem;
    }

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

/* User preferences section */
.preferences-section {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
}

.favorite-crop-tag {
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.favorite-crop-tag button {
    margin-left: 0.5rem;
    color: #1e40af;
    opacity: 0.7;
}

.favorite-crop-tag button:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-navigation {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        display: inline-block;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.loading-pulse {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Tooltip styling */
.custom-tooltip {
    position: relative;
    display: inline-block;
}

.custom-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Price trend indicators */
.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

.trend-stable {
    color: #6b7280;
}

/* Market factor impact indicators */
.impact-positive {
    color: #10b981;
}

.impact-negative {
    color: #ef4444;
}

.impact-neutral {
    color: #6b7280;
}

/* Email modal styling */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-open .modal-content {
    transform: scale(1);
    opacity: 1;
}
