: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;
}

.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;
    gap: 10px;
}

.astro-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.astro-event-row .label {
    font-weight: 600;
    color: #555;
    font-size: 1.3rem;
    width: auto;
    display: inline-block;
}

.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 */
.sun-main-content {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 15px;
    align-items: center;
}

.sun-times {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sun-visual-box {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.sun-photo-container {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
    background: #000;
}

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

/* Moon Visual Integration */
.moon-main-content {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 15px;
    align-items: center;
}

.moon-times {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.moon-visual-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.moon-photo-container {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: #000;
}

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

.phase-name {
    font-size: 1.37rem;
    font-weight: 700;
    color: var(--primary-color);
}

.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;
}

.range-toggles {
    display: flex;
    gap: 12px;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 30px;
}

.range-btn {
    border: none;
    background: transparent;
    padding: 10px 22px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.24rem;
    transition: all 0.3s ease;
    color: #666;
}

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

.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: #2c3e50;
    border-bottom: 1px solid #f0f0f0;
}

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

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

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

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

@media (max-width: 768px) {
    .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;
}

.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; }
