/**
 * mp.ls Hub Frontend Styles
 * Author: Patrick
 */

/* ==========================================
   Dashboard Layout
   ========================================== */

.mpls-hub-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.hub-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hub-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: #4A148C;
    font-family: var(--wp--preset--font-family--heading);
}

/* ==========================================
   Traffic Alerts
   ========================================== */

.mpls-hub-alerts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mpls-alert-summary {
    padding: 12px 16px;
    background: #F5F0FA;
    border: 1px solid #EDE7F6;
    border-radius: 6px;
}

.summary-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    color: #4A148C;
    font-weight: 600;
}

.summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #FFFFFF;
    border: 1px solid #EDE7F6;
    color: #4A148C;
}

.summary-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4A148C;
    display: inline-block;
}

.mpls-alert-featured .mpls-alert-item {
    border-left-width: 6px;
    background: #FFF9F2;
}

.mpls-alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px 0;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #F5F0FA;
    color: #4A148C;
}

.alert-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4A148C;
    display: inline-block;
}

.alert-updated {
    margin: 8px 0 0 0;
    font-size: 0.75rem;
    color: #666;
}

.alert-badge--severity {
    background: #FFF3E0;
    color: #E65100;
}

.alert-badge--severity::before {
    background: #E65100;
}

.alert-badge--priority {
    background: #FBE9E7;
    color: #BF360C;
}

.alert-badge--priority::before {
    background: #BF360C;
}

.category-crash {
    color: #C62828;
}

.category-crash::before {
    background: #C62828;
}

.category-closure {
    color: #6A1B9A;
}

.category-closure::before {
    background: #6A1B9A;
}

.category-incident {
    color: #1565C0;
}

.category-incident::before {
    background: #1565C0;
}

/* Traffic alerts in sidebar/card context - compact style */
.card .mpls-hub-alerts {
    gap: 0;
}

.card .mpls-hub-alerts .mpls-alert-item {
    padding: 0 0 16px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #EDE7F6;
    border-left: none;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.card .mpls-hub-alerts .mpls-alert-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card .mpls-hub-alerts .mpls-alert-item:hover {
    transform: none;
    box-shadow: none;
}

/* Standalone alerts - full card style */
.mpls-alert-item {
    padding: 20px;
    background: #fff;
    border-left: 4px solid #4A148C;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mpls-alert-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mpls-alert-item.severity-low {
    border-left-color: #1976d2;
}

.mpls-alert-item.severity-moderate {
    border-left-color: #f57c00;
}

.mpls-alert-item.severity-high {
    border-left-color: #c62828;
}

.alert-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #1A1A1A;
    font-family: var(--wp--preset--font-family--heading);
    line-height: 1.3;
}

.alert-title a {
    color: #1A1A1A;
    text-decoration: none;
    transition: color 0.2s;
}

.alert-title a:hover {
    color: #4A148C;
}

.alert-location {
    margin: 0 0 8px 0;
    font-size: 0.75rem;
    color: #666;
}

.alert-location strong {
    color: #4A148C;
}

/* Hide location in sidebar context */
.card .mpls-hub-alerts .alert-location {
    display: none;
}

.alert-content {
    margin: 10px 0;
    line-height: 1.5;
    color: #1A1A1A;
    font-size: 0.875rem;
}

/* Hide content in sidebar context */
.card .mpls-hub-alerts .alert-content {
    display: none;
}

.alert-link {
    display: inline-block;
    padding: 6px 12px;
    background: #4A148C;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s;
}

/* Hide link in sidebar context */
.card .mpls-hub-alerts .alert-link {
    display: none;
}

.alert-link:hover {
    background: #6A1B9A;
    color: #fff;
}

.no-alerts {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px 0;
    font-size: 0.875rem;
}

/* ==========================================
   Civic Events
   ========================================== */

.mpls-hub-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Events in sidebar/card context - compact style */
.card .mpls-hub-events .mpls-event-item {
    padding: 0 0 16px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #EDE7F6;
    transition: none;
}

.card .mpls-hub-events .mpls-event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card .mpls-hub-events .mpls-event-item:hover {
    border-color: #EDE7F6;
    box-shadow: none;
}

/* Standalone events - full card style */
.mpls-event-item {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #EDE7F6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mpls-event-item:hover {
    border-color: #4A148C;
    box-shadow: 0 4px 12px rgba(74, 20, 140, 0.1);
}

.event-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #1A1A1A;
    font-family: var(--wp--preset--font-family--heading);
    line-height: 1.3;
}

.event-title a {
    color: #4A148C;
    text-decoration: none;
    transition: color 0.2s;
}

.event-title a:hover {
    color: #6A1B9A;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px 0;
    font-size: 0.75rem;
}

.event-meta span {
    display: inline-flex;
    align-items: center;
    color: #666;
}

.event-meta span::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #4A148C;
    border-radius: 50%;
    margin-right: 6px;
}

.event-date {
    font-weight: 600;
    color: #4A148C;
}

.event-content {
    margin: 10px 0;
    line-height: 1.5;
    color: #1A1A1A;
    font-size: 0.875rem;
}

/* Hide content in sidebar context */
.card .mpls-hub-events .event-content {
    display: none;
}

.event-link {
    display: inline-block;
    padding: 6px 12px;
    background: #4A148C;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s;
}

/* Hide link in sidebar context */
.card .mpls-hub-events .event-link {
    display: none;
}

.event-link:hover {
    background: #6A1B9A;
    color: #fff;
}

.no-events {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px 0;
    font-size: 0.875rem;
}

/* ==========================================
   Single Column Layout
   ========================================== */

.mpls-hub-alerts:not(.mpls-hub-dashboard .mpls-hub-alerts),
.mpls-hub-events:not(.mpls-hub-dashboard .mpls-hub-events) {
    max-width: 800px;
    margin: 30px auto;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .mpls-hub-dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hub-section {
        padding: 20px;
    }

    .hub-section h3 {
        font-size: 1.25rem;
    }

    .mpls-alert-item,
    .mpls-event-item {
        padding: 15px;
    }

    .event-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .alert-link,
    .event-link {
        display: none;
    }

    .mpls-alert-item,
    .mpls-event-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
