/**
 * Maharashtra Tourism Dashboard - Frontend Styles
 * Responsive CSS for frontend dashboard and shortcodes
 */

/* === Base Styles === */
.mtd-frontend-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #334155;
}

/* === Layout Components === */
.mtd-filters-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.mtd-filters-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.mtd-filters {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.mtd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.mtd-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.mtd-filter-group select,
.mtd-filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.mtd-filter-group select:focus,
.mtd-filter-group input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === Buttons === */
.mtd-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.mtd-button-primary {
    background: #3b82f6;
    color: #ffffff;
}

.mtd-button-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.mtd-button-secondary {
    background: #6b7280;
    color: #ffffff;
}

.mtd-button-secondary:hover {
    background: #4b5563;
}

/* === Live Counts === */
.mtd-live-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-live-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.mtd-live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 8px;
    animation: mtd-pulse 2s infinite;
}

@keyframes mtd-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.mtd-live-counts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.mtd-live-count-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    border-left: 4px solid #3b82f6;
}

.mtd-live-count-item h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.mtd-live-total {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 12px;
}

.mtd-category-counts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 12px;
}

.mtd-category-count {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.mtd-category-count span:first-child {
    color: #64748b;
}

.mtd-category-count span:last-child {
    font-weight: 600;
    color: #1e293b;
}

/* === Live Count Values === */
.mtd-live-value {
    font-weight: 700;
    transition: color 0.5s ease;
}

.mtd-value-up {
    color: #10b981;
}

.mtd-value-down {
    color: #ef4444;
}

/* === Charts Section === */
.mtd-charts-section {
    margin-bottom: 24px;
}

.mtd-stats-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-stats-container h3,
.mtd-stats-container h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.mtd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.mtd-stat-item {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.mtd-stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.mtd-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.mtd-chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mtd-chart-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 300px;
}

.mtd-chart-container.mtd-full-width {
    grid-column: 1 / -1;
}

.mtd-chart-container h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* === Tables === */
.mtd-table-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-table-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.mtd-district-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.mtd-district-table th,
.mtd-district-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.mtd-district-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.mtd-district-table td {
    color: #475569;
    font-size: 14px;
}

.mtd-district-table tbody tr:hover {
    background: #f8fafc;
}

/* === Widget Styles === */
.mtd-live-counts-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-chart-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-stats-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-table-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* === Widget Style Variations === */
.mtd-style-grid .mtd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.mtd-style-inline .mtd-stats-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mtd-style-vertical .mtd-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtd-style-list .mtd-live-counts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtd-style-compact .mtd-live-count-item {
    padding: 12px;
}

.mtd-style-compact .mtd-live-total {
    font-size: 18px;
    margin-bottom: 8px;
}

.mtd-style-compact .mtd-category-counts {
    font-size: 11px;
}

/* === Loading States === */
.mtd-loading {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-style: italic;
}

.mtd-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: mtd-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes mtd-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .mtd-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .mtd-filter-group {
        min-width: auto;
    }

    .mtd-chart-row {
        grid-template-columns: 1fr;
    }

    .mtd-live-counts-container {
        grid-template-columns: 1fr;
    }

    .mtd-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .mtd-style-inline .mtd-stats-grid {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .mtd-frontend-dashboard {
        padding: 12px;
    }

    .mtd-filters-section,
    .mtd-live-section,
    .mtd-stats-container,
    .mtd-chart-container,
    .mtd-table-section {
        padding: 16px;
    }

    .mtd-stats-grid {
        grid-template-columns: 1fr;
    }

    .mtd-district-table {
        font-size: 12px;
    }

    .mtd-district-table th,
    .mtd-district-table td {
        padding: 8px;
    }
}

/* === Print Styles === */
@media print {
    .mtd-frontend-dashboard {
        color: #000;
        background: #fff;
    }

    .mtd-filters-section {
        display: none;
    }

    .mtd-live-indicator {
        display: none;
    }

    .mtd-charts-section,
    .mtd-table-section {
        break-inside: avoid;
    }

    .mtd-chart-container {
        border: 1px solid #000;
        margin-bottom: 20px;
    }
}

/* === Accessibility === */
.mtd-frontend-dashboard *:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mtd-live-indicator {
        animation: none;
    }

    .mtd-loading::before {
        animation: none;
    }

    .mtd-button {
        transition: none;
    }
}