/* Basic Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    color: #1a1a1a;
    height: 100vh;
}

#app {
    display: flex;
    height: 100%;
}

#data-container {
    width: 320px;
    padding: 0.2rem;
    box-sizing: border-box;
    background-color: #fafafa;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#data-container header {
    padding: 0;
    box-shadow: none;
    background: none;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: center;
}

#data-container h1 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.header-icon {
    font-size: 1.35rem;
    color: #2563eb;
}

.sidebar-subheading {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    color: #64748b;
}

#map {
    flex: 1;
    height: 100%;
}

.hidden {
    display: none;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.date-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9em;
    color: #333;
    margin-top: 0.75rem;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.date-input-group button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.date-input-group button i {
    font-size: 0.95rem;
    pointer-events: none;
}

.date-input-group button span {
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.date-input-group input[type="date"] {
    flex: 1;
}

#controls label {
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
    color: #333;
    gap: 0.25em;
}

#controls label > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #1f2933;
}

#controls label > span .bi {
    font-size: 1rem;
    color: #1e40af;
}

#controls input[type="date"],
#controls input[type="number"] {
    padding: 0.4em 0.5em;
    border: 1px solid #cbd5f5;
    border-radius: 4px;
    font-size: 0.95em;
}

#controls input[type="number"] {
    -moz-appearance: textfield;
}

#controls input[type="number"]::-webkit-outer-spin-button,
#controls input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.icon-button {
    border: 1px solid #2563eb;
    background-color: #2563eb;
    color: #fff;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
    background-color: #1e40af;
    border-color: #1e40af;
}

.icon-button i {
    font-size: 1.1rem;
    line-height: 1;
}


.coordinate-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.5em;
}

.coordinate-inputs label {
    flex: 1;
}

.coordinate-inputs .icon-button {
    flex: none;
}

.input-error {
    border-color: #c62828 !important;
    background-color: #ffebee;
}

.legend {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    align-items: center;
    justify-content: flex-start;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78em;
    color: #475569;
}

.legend-text {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-text .bi {
    font-size: 0.85rem;
}

.legend-swatch {
    width: 18px;
    height: 4px;
    border-radius: 999px;
    display: inline-block;
}

.legend-item--sunset {
    color: #ff9800;
}

.legend-item--sunset .legend-swatch {
    background-color: currentColor;
}

.legend-item--moonrise {
    color: #3f51b5;
}

.legend-item--moonrise .legend-swatch {
    background-image: repeating-linear-gradient(90deg, currentColor 0, currentColor 8px, transparent 8px, transparent 14px);
    background-size: 14px 100%;
}

.calendar-container {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 600;
}

.month-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.month-nav button i {
    font-size: 1rem;
    pointer-events: none;
}

#month-label {
    font-size: 1.05em;
    flex: 1;
    text-align: center;
}

.month-nav button,
.date-input-group button {
    border: 1px solid #d4d4d4;
    background-color: #fff;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.month-nav button:hover,
.date-input-group button:hover {
    background-color: #e2e8f0;
}

.weekday-row,
#month-preview {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.15rem;
    text-align: center;
}

.weekday-row span {
    font-size: 0.7em;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    padding: 0.15rem 0;
}

#month-preview {
    margin: 0.35rem 0;
}

.month-preview-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-size: 0.75em;
    width: 100%;
    box-sizing: border-box;
}

.month-preview-day:hover {
    border-color: #cbd5e1;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.month-preview-day.is-selected {
    border-color: #2563eb;
    background-color: #e0e7ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.5);
}

.month-preview-day.is-outside {
    background-color: #f1f5f9;
    color: #a8b1c1;
}

.month-preview-day.is-outside .day-icon,
.month-preview-day.is-outside .day-illum {
    color: #cbd5e1;
}

.month-preview-day .day-number {
    font-weight: 600;
    font-size: 0.9em;
}

.month-preview-day .day-icon {
    font-size: 1.35em;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4em;
    height: 1.4em;
    line-height: 1;
}

.month-preview-day[data-phase-icon="◐"] .day-icon,
.month-preview-day[data-phase-icon="◑"] .day-icon {
    font-size: 1.25em;
}

.month-preview-day .day-illum {
    color: #94a3b8;
    font-size: 0.7em;
}

.data-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.data-block + .data-block {
    margin-top: 0.6rem;
}

.data-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.data-label {
    min-width: 6.25rem;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.data-value,
.data-aux {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', 'Segoe UI Mono', 'Roboto Mono', monospace;
    font-size: 0.9em;
    color: #1f2937;
    text-align: right;
}

.data-value {
    flex: 0 0 4.4rem;
}

.data-aux {
    margin-left: auto;
    color: #475569;
    letter-spacing: 0.02em;
    flex: 0 0 5rem;
}

@media (max-width: 900px) {
    #app {
        flex-direction: column;
    }

    #data-container {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    #map {
        flex: none;
        height: 60vh;
    }

    .coordinate-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .coordinate-inputs .icon-button {
        width: 100%;
        border-radius: 6px;
    }

    .stats-grid {
        grid-template-columns: 5.5rem minmax(3.3rem, auto) minmax(3.3rem, auto);
    }

    .stats-row .stats-label {
        min-width: 6.1rem;
    }
}

@media (max-width: 600px) {
    #map {
        height: 55vh;
    }

    .stats-grid {
        grid-template-columns: 5.1rem minmax(3rem, auto) minmax(3rem, auto);
        column-gap: 0.35rem;
    }
}

.message {
    margin: 0;
    padding: 0.5em 0.75em;
    border-radius: 4px;
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.message--info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
}

.message--error {
    background-color: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.message--success {
    background-color: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.message.is-fading {
    opacity: 0;
}
.summary-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.6rem;
    margin-bottom: 0.4rem;
}

.summary-date {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
}

.summary-location {
    display: flex;
    flex-direction: column;
    font-size: 0.82em;
    color: #4b5563;
    gap: 0.1rem;
}

.summary-location span {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', 'Segoe UI Mono', 'Roboto Mono', monospace;
}

.summary-location span:first-child {
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: 7.5rem minmax(4rem, auto) minmax(4rem, auto);
    row-gap: 0.25rem;
    column-gap: 0.5rem;
    align-items: baseline;
    margin-top: 0.6rem;
}

.stats-label {
    font-size: 0.7em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.stats-icon {
    font-size: 1rem;
    color: #334155;
}

.stats-value,
.stats-az {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', 'Segoe UI Mono', 'Roboto Mono', monospace;
    font-size: 0.92em;
    color: #0f172a;
    text-align: right;
    white-space: pre;
}

.stats-value {
    font-weight: 600;
}

.stats-az {
    color: #475569;
}

.stats-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.stats-row .stats-label {
    min-width: 7.5rem;
}

.stats-info {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', 'Segoe UI Mono', 'Roboto Mono', monospace;
    font-size: 0.9em;
    color: #1f2937;
}
