/* General Styles */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Analytics Container */
.analytics-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Analytics Header */
.analytics-header {
    text-align: center;
    margin-bottom: 30px;
}

.analytics-header h2 {
    color: #5C0001;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.analytics-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 150px;
    height: 3px;
    background: linear-gradient(to right, #5C0001, #9B0065);
}

/* Chart Controls */
.chart-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-chart-type {
    border: 1px solid #ddd;
    background-color: white;
    color: #5C0001;
    border-radius: 5px;
    padding: 5px 15px;
    transition: all 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-chart-type:hover {
    background-color: #f0f0f0;
}

.btn-chart-type.active {
    background-color: #5C0001;
    color: white;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-selector label {
    margin-bottom: 0;
    font-weight: 500;
    color: #5C0001;
}

.year-selector select {
    width: 100px;
}

/* Chart Container */
.chart-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 400px;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
    border: 1px solid #eee;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f8f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #5C0001;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #5C0001;
}

.stat-content p {
    margin-bottom: 0;
    color: #666;
    font-size: 14px;
}

/* AI Assistant */
.ai-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5C0001 0%, #9B0065 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.ai-btn:hover {
    transform: scale(1.1);
}

.ai-chat-box {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 350px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-box.show {
    display: flex;
}

.ai-chat-header {
    background: linear-gradient(135deg, #5C0001 0%, #9B0065 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h5 {
    margin: 0;
    font-weight: 600;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.ai-chat-output {
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.ai-msg {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.ai-chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    font-family: 'Tajawal', sans-serif;
}

.ai-send-btn {
    background: linear-gradient(135deg, #5C0001 0%, #9B0065 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .ai-chat-box {
        width: 300px;
        left: 15px;
    }
}

@media (max-width: 576px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .ai-chat-box {
        width: calc(100% - 30px);
        left: 15px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .year-selector {
        justify-content: space-between;
    }
}