/* Analytics Page Styles */

.analytics-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

.analytics-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.analytics-hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.hero-actions {
    margin-bottom: 4rem;
}

.hero-actions .btn {
    margin: 0 10px;
}

.analytics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    justify-items: center;
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
    max-width: 350px;
    width: 100%;
    min-width: 250px;
    justify-content: flex-start;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.metric-trend {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.metric-trend.positive {
    background: rgba(16, 185, 129, 0.3);
}

.metric-trend.negative {
    background: rgba(239, 68, 68, 0.3);
}

.analytics-dashboard {
    padding: 4rem 0;
    background: #f8fafc;
}

.dashboard-controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.time-selector,
.crop-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-selector label,
.crop-selector label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.time-selector select,
.crop-selector select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.time-selector select:focus,
.crop-selector select:focus {
    outline: none;
    border-color: #10b981;
}

.refresh-button {
    margin-left: auto;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.chart-header h3 {
    font-size: 1.2rem;
    color: #374151;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.chart-btn:hover:not(.active) {
    background: #f3f4f6;
}

.insights-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, rgba(var(--theme-analytics-rgb), 0.05) 0%, rgba(var(--theme-analytics-rgb), 0.01) 100%);
    position: relative;
    overflow: hidden;
}

.insights-section::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--theme-analytics-rgb), 0.1) 0%, rgba(var(--theme-analytics-rgb), 0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
}

.insights-section::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--theme-analytics-rgb), 0.08) 0%, rgba(var(--theme-analytics-rgb), 0) 70%);
    bottom: -50px;
    left: -50px;
    z-index: 0;
}

.insights-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: var(--theme-analytics);
    position: relative;
}

.insights-section h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: var(--theme-analytics);
    margin: 1rem auto 2rem;
    border-radius: 2px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(var(--theme-analytics-rgb), 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(var(--theme-analytics-rgb), 0.2);
}

.insight-card.trend-up .insight-header {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.insight-card.alert .insight-header {
    background: linear-gradient(45deg, var(--warning-color), #f39c12);
}

.insight-card.opportunity .insight-header {
    background: linear-gradient(45deg, var(--info-color), #3498db);
}

.insight-card.efficiency .insight-header {
    background: linear-gradient(45deg, #8b5cf6, #9c74fc);
}

.insight-card.warning .insight-header {
    background: linear-gradient(45deg, var(--error-color), #e74c3c);
}

.insight-card.positive .insight-header {
    background: linear-gradient(45deg, #06d6a0, #0de7b8);
}

.insight-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.insight-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 0.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-title h3 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.insight-content {
    padding: 1.5rem;
}

.insight-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.insight-action {
    background: rgba(var(--theme-analytics-rgb), 0.05);
    padding: 1.2rem;
    border-radius: 8px;
    border-left: 0;
    border-top: 3px solid rgba(var(--theme-analytics-rgb), 0.5);
    font-size: 0.95rem;
    margin-top: auto;
    position: relative;
}

.insight-action::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 20px;
    width: 30px;
    height: 3px;
    background-color: var(--theme-analytics);
}

.insight-action strong {
    color: var(--theme-analytics);
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.predictive-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, white 0%, rgba(var(--theme-analytics-rgb), 0.03) 100%);
    position: relative;
}

.predictive-section::before {
    content: "📈";
    position: absolute;
    font-size: 15rem;
    opacity: 0.03;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    color: var(--theme-analytics);
}

.predictive-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: var(--theme-analytics);
    position: relative;
}

.predictive-section h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: var(--theme-analytics);
    margin: 1rem auto 2rem;
    border-radius: 2px;
}

.prediction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.prediction-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 30px rgba(var(--theme-analytics-rgb), 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.prediction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(var(--theme-analytics-rgb), 0.18);
}

.prediction-card h3 {
    font-size: 1.3rem;
    margin: 0;
    color: white;
    text-align: center;
    padding: 1.5rem;
    background: var(--theme-analytics);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    position: relative;
}

.prediction-card:nth-child(1) h3 {
    background: linear-gradient(135deg, var(--theme-analytics), #9c74fc);
}

.prediction-card:nth-child(2) h3 {
    background: linear-gradient(135deg, #3498db, var(--theme-analytics));
}

.prediction-card:nth-child(3) h3 {
    background: linear-gradient(135deg, var(--theme-analytics), #7f00ff);
}

.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: rgba(var(--theme-analytics-rgb), 0.04);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.prediction-item:hover {
    background: rgba(var(--theme-analytics-rgb), 0.08);
    transform: translateX(5px);
}

.prediction-label {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prediction-label::before {
    content: "•";
    color: var(--theme-analytics);
    font-size: 1.5rem;
}

.prediction-value {
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.prediction-value.positive {
    color: #fff;
    background-color: var(--success-color);
}

.prediction-value.negative {
    color: #fff;
    background-color: var(--error-color);
}

.prediction-value.warning {
    color: #fff;
    background-color: var(--warning-color);
}

.prediction-value.neutral {
    color: #fff;
    background-color: var(--text-light);
}

.prediction-confidence {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(var(--theme-analytics-rgb), 0.03);
    border-radius: 12px;
    border-top: 0;
}

.prediction-confidence span {
    font-size: 1rem;
    color: var(--theme-analytics);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: rgba(var(--theme-analytics-rgb), 0.1);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-analytics), #9c74fc);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(var(--theme-analytics-rgb), 0.5);
    animation: pulse-confidence 2s infinite;
}

@keyframes pulse-confidence {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.reports-section {
    padding: 5rem 0;
    background: linear-gradient(0deg, white, rgba(var(--theme-analytics-rgb), 0.04));
    position: relative;
    overflow: hidden;
}

.reports-section::before {
    content: "📊";
    position: absolute;
    font-size: 20rem;
    opacity: 0.03;
    bottom: 0;
    right: 5%;
    color: var(--theme-analytics);
    transform: rotate(15deg);
}

.reports-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: var(--theme-analytics);
    position: relative;
}

.reports-section h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: var(--theme-analytics);
    margin: 1rem auto 3rem;
    border-radius: 2px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.report-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    text-align: center;
    box-shadow: 0 10px 25px rgba(var(--theme-analytics-rgb), 0.08);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-bottom: 5px solid transparent;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.report-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(var(--theme-analytics-rgb), 0.2);
    border-color: var(--theme-analytics);
}

.report-card:hover .report-icon {
    transform: scale(1.1) translateY(-5px);
}

.report-card:hover .report-icon::after {
    opacity: 0.1;
    transform: scale(1.3);
}

.report-icon {
    font-size: 3rem;
    color: white;
    margin: 0 auto 1rem;
    padding-top: 2.5rem;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    width: 80px;
    height: 80px;
}

.report-icon::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--theme-analytics);
    border-radius: 50%;
    left: 0;
    top: 0;
    z-index: -1;
    transform: scale(0.8);
    opacity: 0.8;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-card h3 {
    font-size: 1.3rem;
    margin: 1rem 1.5rem;
    color: var(--theme-analytics);
    font-weight: 700;
}

.report-card p {
    color: #6b7280;
    margin: 0 1.5rem 2rem;
    line-height: 1.6;
    flex-grow: 1;
}

.report-card button {
    margin: 0 1.5rem 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-hero h1 {
        font-size: 2.5rem;
    }
    
    .analytics-overview {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .refresh-button {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .insights-grid,
    .prediction-grid,
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .insight-card {
        flex-direction: column;
        text-align: center;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .analytics-hero {
        padding: 100px 0 60px;
    }
    
    .analytics-hero h1 {
        font-size: 2rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .insight-card,
    .prediction-card,
    .report-card {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .analytics-overview {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .metric-card {
        max-width: 100%;
    }
}
