/**
 * Ward Modal Styles
 * Modal overlay for displaying detailed ward information
 */

/* Modal Overlay */
.ward-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 43, 43, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.ward-modal-overlay.active {
    display: flex;
}

/* Modal Content */
.ward-modal-content {
    background: #FAF6E8;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.ward-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid #B9C98A;
}

.ward-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2F4A2C;
}

.ward-modal-header .name-local {
    font-size: 18px;
    color: #3F5F7A;
    margin-left: 8px;
}

.ward-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #2B2B2B;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.ward-modal-close:hover {
    color: #C45A2A;
}

/* Ward Metadata */
.ward-modal-meta {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2B2B2B;
}

.meta-item i {
    color: #3F5F7A;
}

/* Tabs */
.ward-modal-tabs {
    display: flex;
    padding: 0 24px;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
}

.ward-tab {
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #3F5F7A;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.ward-tab:hover {
    background: #f5f5f5;
}

.ward-tab.active {
    color: #2F4A2C;
    border-bottom-color: #2F4A2C;
}

.ward-tab i {
    font-size: 18px;
}

/* Modal Body */
.ward-modal-body {
    padding: 24px;
    min-height: 200px;
}

.ward-modal-loading,
.ward-modal-error {
    text-align: center;
    padding: 40px 20px;
    color: #3F5F7A;
}

.ward-modal-loading i,
.ward-modal-error i {
    font-size: 48px;
    margin-bottom: 16px;
}

.ward-modal-error {
    color: #C45A2A;
}

.error-detail {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* Metrics Grid */
.ward-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.metric-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2F4A2C;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #2B2B2B;
    margin-bottom: 12px;
}

/* Progress Bar */
.metric-progress {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar.high {
    background: linear-gradient(90deg, #2F4A2C, #B9C98A);
}

.progress-bar.medium {
    background: linear-gradient(90deg, #F5B82E, #C45A2A);
}

.progress-bar.low {
    background: linear-gradient(90deg, #C45A2A, #999);
}

/* Metric Details */
.metric-rank,
.metric-comparison,
.metric-confidence {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.metric-confidence {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-confidence i {
    color: #F5B82E;
    font-size: 12px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Modal Footer */
.ward-modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e0e0e0;
    justify-content: flex-start;
}

.ward-modal-footer button {
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary {
    background: #3F5F7A;
    color: #FAF6E8;
    border: none;
}

.btn-secondary:hover {
    background: #2d4659;
}

.btn-tertiary {
    background: transparent;
    color: #2B2B2B;
    border: 2px solid #2B2B2B;
}

.btn-tertiary:hover {
    background: #f5f5f5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ward-modal-content {
        max-height: 95vh;
        border-radius: 8px;
    }

    .ward-modal-header h2 {
        font-size: 20px;
    }

    .ward-modal-meta {
        flex-direction: column;
        gap: 12px;
    }

    .ward-metrics {
        grid-template-columns: 1fr;
    }

    .ward-modal-tabs {
        padding: 0 12px;
    }

    .ward-tab {
        padding: 12px 16px;
        font-size: 14px;
    }

    .ward-modal-footer {
        flex-direction: column;
    }

    .ward-modal-footer button {
        width: 100%;
        justify-content: center;
    }
}

/* RTL Support (for Urdu) */
[dir="rtl"] .ward-modal-close {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .meta-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .ward-tab {
    flex-direction: row-reverse;
}
