/* Modern UI Refresh - Clean, Professional Design */

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

:root {
    /* Primary color palette - Modern blue/teal */
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #0d5d56;
    --primary-bg: #f0fdfa;

    /* Neutral palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Accent colors for system types */
    --gshp-color: #10b981;
    --gen4-color: #3b82f6;
    --gen5-color: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--slate-700);
    background: linear-gradient(135deg, var(--slate-100) 0%, var(--slate-200) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
    background-color: white;
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
}

/* Header */
header {
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    margin-bottom: 24px;
    color: white;
}

h1 {
    color: white;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05em;
    font-weight: 400;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background-color: var(--slate-50);
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    flex-wrap: wrap;
    align-items: center;
}

.filter-section, .search-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

label {
    font-weight: 600;
    color: var(--slate-600);
    font-size: 0.9em;
}

select, input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    color: var(--slate-700);
    transition: all 0.2s ease;
}

select:hover, input[type="text"]:hover {
    border-color: var(--slate-400);
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

select {
    min-width: 220px;
    cursor: pointer;
}

input[type="text"] {
    min-width: 300px;
}

input[type="text"]::placeholder {
    color: var(--slate-400);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1.8fr 6px 1fr;
    gap: 0;
    margin-bottom: 24px;
}

/* Resize Handle */
.resize-handle {
    width: 6px;
    cursor: col-resize;
    background: var(--slate-200);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.resize-handle:hover,
.resize-handle.dragging {
    background: var(--primary-light);
}

#map {
    height: 620px;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-right: 12px;
}

/* Info Panel */
.info-panel {
    background-color: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--slate-200);
    max-height: 620px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    margin-left: 12px;
}

.info-panel::-webkit-scrollbar {
    width: 6px;
}

.info-panel::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

.info-placeholder h3 {
    color: var(--slate-800);
    margin-bottom: 12px;
    font-size: 1.3em;
    font-weight: 700;
}

.info-placeholder > p {
    margin-bottom: 20px;
    color: var(--slate-500);
    font-size: 0.95em;
}

/* Policy Highlight Section */
.policy-highlight {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #ccfbf1 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #99f6e4;
}

.policy-highlight h4 {
    color: var(--primary-dark);
    margin-bottom: 16px;
    font-size: 1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-highlight h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.policy-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.policy-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(20, 184, 166, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.policy-point:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.policy-icon {
    font-size: 1.3em;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-100);
    border-radius: 8px;
}

.policy-point strong {
    color: var(--slate-800);
    display: block;
    margin-bottom: 2px;
    font-size: 0.9em;
    font-weight: 600;
}

.policy-point p {
    margin: 0;
    font-size: 0.82em;
    color: var(--slate-600);
    line-height: 1.5;
}

/* Legend */
.legend {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
}

.legend h4 {
    color: var(--slate-700);
    margin-bottom: 14px;
    font-size: 0.95em;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--slate-100);
}

.legend-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legend-text {
    flex: 1;
}

.legend-title {
    font-weight: 600;
    color: var(--slate-700);
    display: block;
    margin-bottom: 3px;
    font-size: 0.88em;
}

.legend-desc {
    font-size: 0.8em;
    color: var(--slate-500);
    line-height: 1.45;
    display: block;
}

.marker-dot {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 2px solid white;
    margin-top: 2px;
    box-shadow: var(--shadow);
}

.marker-dot.gshp {
    background-color: var(--gshp-color);
}

.marker-dot.gen4 {
    background-color: var(--gen4-color);
}

.marker-dot.gen5 {
    background-color: var(--gen5-color);
}

/* Back Button */
.back-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 16px;
    transition: background 0.2s ease;
}

.back-button:hover {
    background: var(--primary-dark);
}

/* Project Details */
.project-details {
    animation: fadeIn 0.3s ease-out;
}

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

.project-details h3 {
    color: var(--slate-800);
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    font-size: 1.2em;
    font-weight: 700;
}

.detail-section {
    margin: 18px 0;
    padding: 14px;
    background: var(--slate-50);
    border-radius: 10px;
    border: 1px solid var(--slate-100);
}

.state-goal-section {
    background: var(--slate-100);
    border: 1px solid var(--slate-300);
}

.detail-section h4 {
    color: var(--slate-700);
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section p, .detail-section ul {
    color: var(--slate-600);
    font-size: 0.95em;
    margin-left: 0;
}

.detail-section ul {
    list-style-type: none;
}

.detail-section li {
    margin-bottom: 6px;
}

.detail-section li strong {
    color: var(--slate-700);
}

/* System Badge */
.system-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.system-badge.gshp {
    background-color: var(--gshp-color);
    color: white;
}

.system-badge.gen4,
.system-badge.\34 gdhc {
    background-color: var(--gen4-color);
    color: white;
}

.system-badge.gen5,
.system-badge.\35 gdhc {
    background-color: var(--gen5-color);
    color: white;
}

/* Resources */
.resources {
    margin-top: 18px;
    padding: 14px;
    background: var(--slate-50);
    border-radius: 10px;
    border: 1px solid var(--slate-100);
}

.resources h4 {
    color: var(--slate-700);
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 600;
}

.resources a {
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    font-size: 0.95em;
    transition: color 0.2s;
}

.resources a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Glossary Section */
.glossary {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
}

.glossary h4 {
    color: var(--slate-700);
    margin-bottom: 14px;
    font-size: 0.95em;
    font-weight: 600;
}

.glossary dl {
    margin: 0;
}

.glossary dt {
    font-weight: 600;
    color: var(--slate-700);
    margin-top: 12px;
    font-size: 0.88em;
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dd {
    margin-left: 0;
    margin-top: 4px;
    color: var(--slate-500);
    font-size: 0.82em;
    line-height: 1.5;
    padding-left: 12px;
    border-left: 2px solid var(--slate-200);
}

/* System Type Info in Project Details */
.system-type-info {
    margin-bottom: 16px;
}

.system-type-explainer {
    font-size: 0.85em;
    color: var(--slate-600);
    font-style: italic;
    margin-top: 10px;
    padding: 10px 14px;
    background-color: var(--primary-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* Technical Details Explainers */
.section-explainer {
    font-size: 0.82em;
    color: var(--slate-500);
    font-style: italic;
    margin-bottom: 12px;
}

.tech-item {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--slate-200);
}

.tech-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.tech-explainer {
    font-size: 0.78em;
    color: var(--slate-500);
    margin-top: 6px;
    padding: 8px 12px;
    background-color: white;
    border-radius: 6px;
    line-height: 1.45;
    border: 1px solid var(--slate-100);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--slate-500);
    font-size: 0.85em;
    border-top: 1px solid var(--slate-200);
    margin-top: 8px;
}

/* Custom Leaflet styles */
.leaflet-marker-icon {
    border-radius: 50%;
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    background: transparent !important;
}

.marker-pin {
    cursor: pointer;
}

.custom-marker:hover .marker-pin {
    transform: scale(1.3);
}

.leaflet-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.leaflet-popup-content {
    margin: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
}

.leaflet-tooltip {
    background: var(--slate-800);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: var(--shadow-md);
}

.leaflet-tooltip-top:before {
    border-top-color: var(--slate-800);
}

/* Map Legend */
.map-legend {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    line-height: 1.6;
}

.map-legend .legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--slate-800);
}

.map-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-600);
}

.map-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr !important;
    }

    .resize-handle {
        display: none;
    }

    #map {
        height: 450px;
        margin-right: 0;
    }

    .info-panel {
        max-height: none;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .controls {
        flex-direction: column;
        padding: 14px;
    }

    .filter-section, .search-section {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    select, input[type="text"] {
        width: 100%;
    }

    h1 {
        font-size: 1.6em;
    }

    .policy-point {
        padding: 10px;
    }
}
