/* ===== Модалка описания дня / события ===== */
.dayinfo-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dayinfo-modal.open {
    display: flex;
    animation: dayinfoFade 0.2s ease-out;
}
@keyframes dayinfoFade { from { opacity: 0; } to { opacity: 1; } }
.dayinfo-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.dayinfo-window {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: auto;
    max-height: 90vh;
    background: #0a0c10;
    border: 1px solid rgba(255, 165, 0, 0.4);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(255, 165, 0, 0.15),
        0 24px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(255, 165, 0, 0.15);
    overflow: hidden;
    animation: dayinfoZoom 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes dayinfoZoom {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.dayinfo-window iframe {
    display: block;
    width: 100%;
    height: 300px;
    border: 0;
    background: #0a0c10;
    transition: height 0.15s ease;
}
.dayinfo-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #FFA500;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.15s, transform 0.15s, color 0.15s;
}
.dayinfo-close:hover {
    background: rgba(255, 165, 0, 0.35);
    color: #FFFFFF;
    transform: scale(1.08);
}
.dayinfo-close:active { transform: scale(0.95); }

/* ===== Шапка приложения ===== */
.moon-app {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(160deg, #14161c 0%, #0d0f13 100%);
    border: 1px solid #2a2f3a;
    border-radius: 22px;
    padding: 18px;
    margin: 0 auto;
    max-width: 1000px;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', Arial, sans-serif;
    color: #E6E6FA;
    position: relative;
}
.moon-app * { box-sizing: border-box; }

.moon-app-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255,165,0,0.14), rgba(255,235,59,0.04));
    border: 1px solid rgba(255,165,0,0.32);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.moon-app-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    line-height: 1;
    border-radius: 12px;
    background: rgba(255,165,0,0.15);
    border: 1px solid rgba(255,165,0,0.4);
    box-shadow: 0 0 18px rgba(255,165,0,0.25);
    filter: drop-shadow(0 0 8px rgba(255,235,59,0.5));
}
.moon-app-titles { flex: 1 1 auto; min-width: 0; }
.moon-app-title {
    font-size: 1.15em;
    font-weight: bold;
    color: #FFFFFF;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(255,165,0,0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.moon-app-sub {
    font-size: 0.82em;
    color: #FFEB3B;
    opacity: 0.9;
    margin-top: 2px;
    line-height: 1.2;
}

.moon-coords {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 14px !important;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    height: auto !important;
    color: #BFBFBF !important;
    font-family: inherit !important;
}
.moon-coords-item {
    display: inline-block !important;
    padding: 5px 11px !important;
    margin: 0 !important;
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 9px !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    height: auto !important;
    font-size: 13px !important;
}
.moon-coords-item b { color: #FFEB3B !important; font-weight: bold !important; }
.moon-coords-city {
    display: inline-block !important;
    padding: 5px 12px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, rgba(255,165,0,0.22), rgba(255,235,59,0.06)) !important;
    border: 1px solid rgba(255,165,0,0.5) !important;
    border-radius: 9px !important;
    color: #FFA500 !important;
    font-weight: bold !important;
    white-space: nowrap !important;
    box-shadow: 0 0 12px rgba(255,165,0,0.15) !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    height: auto !important;
}
.moon-coords-city b { color: #FFEB3B !important; }
.moon-coords-edit {
    display: inline-block !important;
    padding: 5px 12px !important;
    margin: 0 !important;
    color: #FFA500 !important;
    text-decoration: none !important;
    background: rgba(255,165,0,0.1) !important;
    border: 1px dashed rgba(255,165,0,0.5) !important;
    border-radius: 9px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
    height: auto !important;
    transition: all 0.18s ease !important;
    font-size: 13px !important;
}
.moon-coords-edit:hover {
    background: rgba(255,165,0,0.3) !important;
    border-style: solid !important;
    color: #FFFFFF !important;
}

.moon-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px;
    align-items: start;
}
.moon-main-data { min-width: 0; }
.moon-main-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: linear-gradient(150deg, #1f232c 0%, #16181d 100%);
    border: 1px solid #2c323d;
    border-radius: 16px;
}

/* ===== Оверлей загрузки ===== */
.moon-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    background: rgba(10, 12, 16, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 22px;
    z-index: 50;
    animation: moonLoadFade 0.22s ease-out;
}
.moon-loading.active { display: flex; }
@keyframes moonLoadFade { from { opacity: 0; } to { opacity: 1; } }
.moon-loading-spinner {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.moon-loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 5px solid rgba(255,165,0,0.12);
    border-top-color: #FFA500;
    border-right-color: rgba(255,165,0,0.55);
    animation: moonSpin 0.9s linear infinite;
    box-shadow: 0 0 30px rgba(255,165,0,0.3),
                inset 0 0 16px rgba(255,165,0,0.08);
}
.moon-loading-ring.ring2 {
    inset: 8px;
    border-width: 3px;
    border-color: rgba(255,235,59,0.06);
    border-bottom-color: #FFEB3B;
    border-left-color: rgba(255,235,59,0.4);
    animation: moonSpin 1.4s linear infinite reverse;
    box-shadow: 0 0 18px rgba(255,235,59,0.2);
}
.moon-loading-moon {
    font-size: 30px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(255,235,59,0.7));
    animation: moonPulse 1.8s ease-in-out infinite;
}
.moon-loading-text {
    color: #FFA500;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-shadow: 0 0 12px rgba(255,165,0,0.5);
    animation: moonPulse 1.8s ease-in-out infinite;
    text-align: center;
    padding: 0 20px;
    line-height: 1.4;
}
.moon-loading-sub {
    display: block;
    margin-top: 6px;
    color: #8b93a4;
    font-size: 0.78em;
    font-weight: normal;
    text-shadow: none;
    letter-spacing: 0;
}
@keyframes moonSpin { to { transform: rotate(360deg); } }
@keyframes moonPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(0.94); }
}
.moon-nav-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ===== Лоадеры над встроенными iframe ===== */
.iframe-wrap {
    position: relative;
    display: block;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}
.iframe-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: linear-gradient(160deg, #14161c 0%, #0d0f13 100%);
    border-radius: 20px;
    z-index: 5;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
}
.iframe-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.iframe-loader-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.iframe-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(255,165,0,0.12);
    border-top-color: #FFA500;
    border-right-color: rgba(255,165,0,0.45);
    animation: iframeSpinner 0.9s linear infinite;
    box-shadow: 0 0 24px rgba(255,165,0,0.25),
                inset 0 0 12px rgba(255,165,0,0.06);
}
.iframe-loader-moon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255,235,59,0.6));
    animation: iframePulse 1.8s ease-in-out infinite;
}
.iframe-loader-text {
    color: #FFA500;
    font-size: 0.95em;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-shadow: 0 0 10px rgba(255,165,0,0.4);
    animation: iframePulse 1.8s ease-in-out infinite;
    text-align: center;
    padding: 0 16px;
    line-height: 1.4;
}
@keyframes iframeSpinner { to { transform: rotate(360deg); } }
@keyframes iframePulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%      { opacity: 0.65; transform: scale(0.94); }
}

/* ===== Мобильная адаптация ===== */
@media (max-width: 720px) {
    .moon-app { padding: 12px; border-radius: 16px; gap: 10px; }
    .moon-app-header { padding: 10px 12px; gap: 10px; border-radius: 14px; }
    .moon-app-icon { width: 38px; height: 38px; font-size: 1.3em; border-radius: 10px; }
    .moon-app-title { font-size: 1em; }
    .moon-app-sub   { font-size: 0.74em; }

    .moon-coords { padding: 8px 10px !important; gap: 5px !important; border-radius: 12px !important; }
    .moon-coords-item,
    .moon-coords-city,
    .moon-coords-edit { font-size: 11px !important; padding: 3px 8px !important; }

    .moon-main { grid-template-columns: 1fr; gap: 10px; }
    .moon-main-circle { padding: 14px 12px; border-radius: 14px; }

    .moon-loading-spinner { width: 66px; height: 66px; }
    .moon-loading-moon    { font-size: 24px; }
    .moon-loading-text    { font-size: 0.9em; }

    .iframe-loader-spinner { width: 60px; height: 60px; }
    .iframe-loader-moon    { font-size: 22px; }
    .iframe-loader-text    { font-size: 0.85em; }
    .iframe-loader         { border-radius: 14px; }
}

@media (max-width: 480px) {
    .dayinfo-modal { padding: 8px; }
    .dayinfo-window {
        height: auto;
        max-height: 94vh;
        border-radius: 14px;
    }
    .dayinfo-close { top: 6px; right: 6px; width: 34px; height: 34px; }
}
