/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #3b82f6;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    margin-right: 5px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #3b82f6;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom: 2px solid #3b82f6;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Add these CSS rules to your styles.css file */

/* Make sure all tab content is hidden by default */
.tab-content {
    display: none;
}

/* Show only active tab content */
.tab-content.active {
    display: block;
}

/* Style for active tab button */
a.active, button.active {
    color: #3b82f6;
    border-bottom: 2px solid #3b82f6;
    font-weight: 500;
}


/* Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 640px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.metric {
    font-size: 24px;
    font-weight: 700;
}

/* Charts */
.chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container h2 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.chart {
    width: 100%;
    height: 300px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 1024px) {
    .chart-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Store Summary */
.store-summary {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .store-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .store-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}

.store-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
}

.store-card h3 {
    font-weight: 600;
    margin-bottom: 10px;
}

.store-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.store-metric p:first-child {
    font-size: 12px;
    color: #666;
}

.store-metric p:last-child {
    font-weight: 500;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f9fafb;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

/* Store Details */
.store-detail-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.store-detail-card h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.store-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.store-metric-card {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
}

.store-metric-card p:first-child {
    font-size: 13px;
    color: #666;
}

.store-metric-card p:last-child {
    font-weight: 600;
    font-size: 18px;
}

/* Error message */
.error-message {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}
