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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #0056b3;
    color: white;
    padding: 20px;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

h1 {
    font-size: 24px;
    margin: 0;
}

.storm-selector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    font-size: 16px;
    background-color: white;
    color: #333;
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 80px); /* Subtract header height */
    overflow: hidden;
}

.map-container {
    position: relative;
    height: 100%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#viewDiv {
    width: 100%;
    height: 100%;
}

.layer-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    transition: transform 0.3s ease;
}

.layer-controls.collapsed {
    transform: translateX(calc(100% - 40px));
}

.layer-controls-toggle {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border: none;
    border-radius: 4px 0 0 4px;
    padding: 8px;
    cursor: pointer;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
    display: none;
}

.layer-controls-toggle::before {
    content: "◀";
    font-size: 12px;
}

.layer-controls.collapsed .layer-controls-toggle::before {
    content: "▶";
}

.layer-toggle {
    margin-bottom: 8px;
}

.layer-toggle:last-child {
    margin-bottom: 0;
}

.layer-toggle label {
    margin-left: 8px;
    font-size: 14px;
}

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.card {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #0056b3;
}

.card.severe::after {
    background: #dc3545;
}

.card.moderate::after {
    background: #ffc107;
}

.card.mild::after {
    background: #28a745;
}

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

.card p {
    font-size: 20px;
    font-weight: bold;
    color: #0056b3;
}

.details-panel {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #0056b3;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }

    .map-container {
        height: 50vh;
    }

    .info-panel {
        height: auto;
    }
}

@media (max-width: 768px) {
    header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2;
        background: rgba(0, 86, 179, 0.9);
        backdrop-filter: blur(5px);
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    main {
        grid-template-columns: 1fr;
        height: 100vh;
        padding: 0;
        gap: 0;
        padding-top: 120px; /* Add padding to account for header height */
    }

    .map-container {
        height: calc(100vh - 120px); /* Subtract header height */
        border-radius: 0;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .layer-controls {
        transform: none;
        position: absolute;
        top: 20px;
        right: 20px;
        background-color: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1;
    }

    .layer-controls-toggle {
        display: none;
    }

    .esri-legend {
        position: absolute;
        bottom: 20px;
        left: 20px;
        background-color: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1;
        transform: none;
    }

    .legend-toggle {
        display: none;
    }

    .summary-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .landfall-grid {
        grid-template-columns: 1fr;
    }

    .info-panel {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: white;
        z-index: 1000;
        transition: right 0.3s ease;
        padding: 20px;
        overflow-y: auto;
    }

    .info-panel.expanded {
        right: 0;
    }

    .info-panel-toggle {
        position: fixed;
        right: 20px;
        bottom: 20px;
        background: #0056b3;
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 24px;
        z-index: 1001;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .info-panel-toggle::before {
        content: "≡";
    }

    .info-panel.expanded + .info-panel-toggle::before {
        content: "×";
    }

    /* Ensure map view takes full height of container */
    #viewDiv {
        height: 100% !important;
    }
}

.selectors {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.selectors select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    min-width: 200px;
}

.infrastructure-table-container {
    margin-top: 1rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

#infrastructureTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    flex: 1;
}

#infrastructureTable th,
#infrastructureTable td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#infrastructureTable th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 1;
}

#infrastructureTable tbody {
    overflow-y: auto;
}

#infrastructureTable tbody tr:hover {
    background-color: #f0f0f0;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.splash-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.splash-content h2 {
    color: #0056b3;
    margin-bottom: 1rem;
}

.splash-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.splash-content ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 2rem;
}

.splash-content li {
    margin-bottom: 0.5rem;
}

.accept-button {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.accept-button:hover {
    background-color: #003d82;
}

.splash-screen.hidden {
    display: none;
}

.infrastructure-summary {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.stat-item {
    text-align: center;
    position: relative;
    padding-left: 20px;
}

.stat-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #0056b3;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0056b3;
}

.type-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.type-count-item {
    background-color: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.type-count-item .count {
    font-weight: bold;
    color: #0056b3;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.landfall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.landfall-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.landfall-item .label {
    font-size: 0.9rem;
    color: #666;
}

.landfall-item .value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #0056b3;
}

/* Loading States */
.loading {
    position: relative;
    min-height: 100px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-tooltip]:hover::before {
    visibility: visible;
    opacity: 1;
}

/* Last Updated Timestamp */
.last-updated {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Share Button */
.share-button {
    background: #0056b3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

.share-button:hover {
    background: #003d82;
}

/* Trend Indicators */
.trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.trend.up {
    color: #dc3545;
}

.trend.down {
    color: #28a745;
}

.trend::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.trend.up::before {
    border-bottom: 5px solid currentColor;
}

.trend.down::before {
    border-top: 5px solid currentColor;
}

/* Breakdown Popup Styles */
.breakdown-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #0056b3;
}

.breakdown-header h3 {
    margin: 0;
    color: #0056b3;
    font-size: 1.2rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0 5px;
}

.close-button:hover {
    color: #0056b3;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.breakdown-table th,
.breakdown-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.breakdown-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.breakdown-table tbody tr:hover {
    background-color: #f8f9fa;
}

.breakdown-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-item .label {
    font-size: 0.9rem;
    color: #666;
}

.summary-item .value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0056b3;
}

/* Mobile styles for breakdown popup */
@media (max-width: 768px) {
    .breakdown-popup {
        width: 95%;
        max-height: 80vh;
        padding: 15px;
    }

    .breakdown-table {
        font-size: 0.8rem;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 6px;
    }

    .breakdown-summary {
        grid-template-columns: 1fr;
    }
}

.breakdown-table .state-row {
    background-color: #f0f7ff;
    font-weight: bold;
}

.breakdown-table .state-row td {
    padding: 12px 8px;
    border-bottom: 2px solid #0056b3;
}

.breakdown-table .state-total {
    color: #0056b3;
}

.breakdown-table .county-row td {
    padding-left: 20px;
}

.breakdown-table .county-row:hover {
    background-color: #f8f9fa;
}

/* Add subtle indentation for county rows */
.breakdown-table .county-row td:first-child {
    padding-left: 30px;
}

/* Add subtle separator between states */
.breakdown-table .state-row + .county-row td {
    border-top: 1px solid #eee;
}

.disclaimer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.dont-show-again input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dont-show-again span {
    font-size: 0.9rem;
    color: #666;
}

@media (min-width: 768px) {
    .disclaimer-options {
        flex-direction: row;
        justify-content: space-between;
    }
} 