:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --sun-gradient: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%);
    --moon-gradient: linear-gradient(135deg, #eceff1 0%, #cfd8dc 100%);
}

body {
    background: #f4f7f6;
    font-family: 'Roboto', sans-serif;
}

.astro-wrapper {
    padding-bottom: 50px;
    font-size: 1.15rem; /* Increase base size by approx 30% from site base */
}

/* Ensure the standard cityname title does NOT scale */
.astro-wrapper .cityname {
    font-size: 28px !important;
}

.nopadding {
    padding: 0 !important;
}

.no-margins {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.astro-description {
    font-size: 1.69rem;
    color: #333;
    line-height: 1.6;
}

.astro-map-container {
    height: 500px;
    width: 100%;
    position: relative;
    border-bottom: 2px solid #ddd;
    background: #eee;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Soften the dark map theme */
.dark-mode-map .leaflet-tile-container {
    filter: brightness(1.2) contrast(0.9) grayscale(20%);
}

.map-style-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
}

.style-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.17rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #555;
}

.style-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.style-btn:hover:not(.active) {
    background: rgba(0,0,0,0.05);
}

.info-row {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.astro-info-box {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    margin: 0 auto;
}

.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.info-header h2 {
    margin: 0;
    font-size: 2.08rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#coordsDisplay {
    color: #7f8c8d;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.3rem;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 6px;
}

.btn-locate {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.56rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-locate:hover {
    transform: scale(1.1);
    background: #c0392b;
}

.info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.sun-box, .moon-box {
    padding: 15px;
    border-radius: 12px;
    transition: transform 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sun-box:hover, .moon-box:hover {
    transform: translateY(-5px);
}

.sun-box {
    background: var(--sun-gradient);
    border: 1px solid #fff59d;
}

.moon-box {
    background: var(--moon-gradient);
    border: 1px solid #e0e0e0;
}

.info-content h3 {
    margin-top: 0;
    font-size: 1.43rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Interactive Info Panels */
.info-toggle {
    cursor: pointer;
    font-size: 1.1rem;
    color: rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    padding: 5px;
}

.info-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.astro-info-panel {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    margin-bottom: 0;
}

.astro-info-panel.active {
    max-height: 500px;
    margin-bottom: 15px;
    border: 1px solid rgba(0,0,0,0.05);
}

.astro-info-panel .info-content {
    display: block; /* Override grid in help panel */
    padding: 12px 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

.astro-info-panel p {
    margin-bottom: 10px;
}

.astro-info-panel p:last-child {
    margin-bottom: 0;
}

.astro-info-panel strong {
    color: var(--primary-color);
    font-weight: 700;
}

.astro-event-row {
    display: flex;
    justify-content: flex-start; /* Changed from space-between */
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    gap: 10px; /* Gap between label and value */
}

.astro-event-row:last-child {
    border-bottom: none;
}

.astro-event-row .label {
    font-weight: 600;
    color: #555;
    font-size: 1.3rem;
    width: 90px; /* Fine-tuned from 95px */
    display: inline-block;
    flex-shrink: 0;
}

.astro-event-row .value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.43rem;
}

.moon-phase {
    display: flex;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
    background: rgba(255,255,255,0.4);
    padding: 15px;
    border-radius: 12px;
}

.illum-val {
    font-size: 1.3rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* Sun Visual Integration */
.astro-main-content {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.sun-data-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 4px;
}

.sun-times-extra {
    margin-top: 10px;
    padding-top: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-toggle {
    cursor: pointer;
    font-size: 0.9em;
    color: rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    margin-left: auto;
}

.info-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.astro-info-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    margin: 0;
}

.visual-col {
    flex: 0 0 100px;
    min-width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 25px; /* Clear space from data */
}

.photo-wrapper img {
    max-width: 100px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.astro-info-panel.active {
    max-height: 500px;
    margin: 10px 0;
    border: 1px solid rgba(0,0,0,0.05);
}

.astro-info-panel .info-content {
    padding: 15px;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

.astro-info-panel p {
    margin-bottom: 8px;
}

.astro-info-panel p:last-child {
    margin-bottom: 0;
}

.astro-info-panel strong {
    color: var(--primary-color);
}

/* Unified Astro Card Layout */
.astro-main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Move image to top */
    gap: 15px;
    padding-top: 10px;
}

.astro-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-right: 15px; /* Prevent overlap with photo column */
    min-width: 0;
}

.astro-col.visual-col {
    flex: 0 0 100px;
    min-width: 100px;
    align-items: center;
    text-align: center;
    border-left: 1px solid rgba(0,0,0,0.05);
    padding-left: 10px;
    margin-top: 5px;
}

.sun-times, .moon-times, .sun-times-extra, .moon-times-extra {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.astro-event-row .label {
    color: #666;
    font-weight: 500;
}

.astro-event-row .value {
    font-weight: 700;
    color: #333;
}

.astro-event-row.secondary-event .label {
    font-weight: 400;
    color: #888;
}

.astro-event-row.secondary-event .value {
    color: #555;
    white-space: nowrap; /* Prevent wrapping */
}

.astro-event-row.photography-row {
    font-size: 12px;
}

.astro-event-row i.fa-camera {
    margin-right: 4px;
}

.gold-hour-icon { color: #d4af37; }
.blue-hour-icon { color: #4169e1; }

.visual-box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.photo-wrapper {
    width: 80px; /* Bigger */
    height: 80px; /* Bigger */
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    border: 3px solid rgba(255,255,255,0.9);
    background: #000;
}

.moon-phase-row {
    white-space: nowrap;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Match other rows */
}

.moon-phase-row .value {
    font-size: 13px;
    line-height: 1.3;
    color: #333;
    font-weight: 700;
    white-space: nowrap; /* Force one line */
}

.visual-box-content .illum-val {
    width: 72px; /* Fixed width for label column */
    font-weight: 700;
    color: #666;
    text-align: left; /* Align to left as requested */
    flex-shrink: 0;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.phase-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phase-summary .phase-name {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-summary .illum-val {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.forecast-row {
    margin-top: 50px;
}

.forecast-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.forecast-header h2 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.69rem;
}

/* Premium Slider Styling */
.range-slider-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 250px;
}

.range-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.17rem;
    font-weight: 600;
    color: var(--primary-color);
}

.range-value {
    color: var(--accent-color);
    font-size: 1.43rem;
    font-weight: 700;
    background: #f1f4f6;
    padding: 2px 10px;
    border-radius: 6px;
    min-width: 45px;
    text-align: center;
}

.premium-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e6ed;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-color);
}

.premium-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.astro-table {
    margin-top: 10px;
    border-collapse: separate;
    border-spacing: 0;
}

.astro-table thead th {
    background: #f1f4f6;
    color: #5a6c7d;
    text-transform: uppercase;
    font-size: 1.04rem;
    letter-spacing: 1.5px;
    padding: 18px;
    border: none;
}

.astro-table tbody td {
    padding: 18px;
    vertical-align: middle;
    font-size: 1.37rem;
    color: #222;
    border-bottom: 1px solid #f0f0f0;
}

.astro-table tbody tr:last-child td {
    border-bottom: none;
}

.phase-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phase-text {
    display: flex;
    flex-direction: column;
}

.moon-emoji-sm {
    font-size: 2.34rem;
}

.illum-pct-sm, .moon-age-sm {
    font-size: 0.85em;
    color: #555;
    margin-top: 2px;
}

.sun-times-cell, .moon-times-cell {
    display: flex;
    flex-direction: column;
}

.duration-text {
    font-size: 0.85em;
    color: #555;
    margin-top: 2px;
}

.date-container {
    display: flex;
    flex-direction: column;
}

.special-event-label {
    font-size: 11px;
    color: #e67e22;
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.full-moon-row {
    background-color: rgba(255, 215, 0, 0.07) !important;
}

.full-moon-row td {
    font-weight: 700 !important;
    color: #000 !important;
}

.full-moon-row td:first-child {
    border-left: 4px solid #f1c40f !important;
}

@media (max-width: 992px) {
    .info-content {
        grid-template-columns: 1fr;
    }
    .event-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 768px) {
    .astro-main-content {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .sun-data-grid {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 5px;
    }

    .visual-col {
        margin-left: 0;
        margin-bottom: 10px;
        order: -1; /* Move image to top on mobile */
    }

    .astro-event-row {
        justify-content: space-between;
        width: 100%;
    }

    .astro-event-row .label {
        width: auto;
        font-size: 1.17rem;
    }

    .astro-event-row .value {
        font-size: 1.3rem;
    }

    .info-row {
        margin-top: 20px;
    }
    .astro-info-box {
        padding: 20px;
    }
    .forecast-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .info-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    .info-content {
        grid-template-columns: 1fr;
    }
    .astro-map-container {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        border-radius: 15px;
    }

    .astro-table th:first-child,
    .astro-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background: #fff !important;
        box-shadow: 4px 0 8px rgba(0,0,0,0.08);
    }

    .astro-table th:first-child {
        background: #f1f4f6 !important;
        z-index: 11;
    }

    .astro-table th, .astro-table td {
        white-space: nowrap;
    }
}

/* Tooltip Styles */
.leaflet-tooltip-astro {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 10px !important;
    padding: 10px 15px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    color: var(--primary-color) !important;
    font-size: 1.17rem !important;
    line-height: 1.4 !important;
    transition: opacity 0.4s ease-in-out !important;
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

.astro-tooltip {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tooltip-coords {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.04rem;
    color: #7f8c8d;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.color-sun { color: #f39c12; }
.color-moon { color: #34495e; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .astro-main-content {
        flex-direction: column;
        gap: 20px;
    }

    .astro-col {
        width: 100%;
        flex: none !important;
    }

    .visual-col {
        order: -1; /* Move photo to top for mobile */
        width: 100% !important;
        flex: none !important;
        align-items: center;
        border-left: none !important;
        padding-left: 0 !important;
        margin-bottom: 10px;
    }

    .astro-card {
        padding: 20px 15px;
    }

    .moon-phase-row {
        white-space: normal; /* Allow wrapping on mobile */
    }

    .moon-phase-row .value {
        display: inline;
    }

    .secondary-event {
        white-space: normal !important;
    }
}

/* Header Styling and Spacing */
.astro-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.56rem;
    color: var(--primary-color);
}

.astro-card h3 i:first-child {
    width: 20px;
    text-align: center;
}

#moonCardTitle {
    font-weight: inherit;
}
