/* Stellarium Web — application styles. */

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #000;
}

.semi-transparent { opacity: 0.5; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }

.radecVal {
    display: inline-block;
    font-family: monospace;
    padding-right: 2px;
    font-size: 13px;
    font-weight: bold;
}

.radecUnit {
    color: #dddddd;
    font-weight: normal;
}

.info-card {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    /* The card sits over the live sky canvas, which can be bright (daytime,
       moon, atmosphere). Use a near-opaque dark backdrop + heavy blur so the
       card is readable on any background, day or night. */
    background-color: rgba(14, 18, 24, 0.92) !important;
    background-image: linear-gradient(180deg,
            rgba(28, 36, 48, 0.55) 0%,
            rgba(14, 18, 24, 0.0) 100%) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    color: #f5f5f5 !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.55),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.info-card h3 {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.info-card .v-card__title,
.info-card .v-card__text {
    color: #f5f5f5 !important;
}

/* Labels (left column) — readable but de-emphasized */
.info-card .v-card__text .flex.xs4 {
    color: #b8c2cc !important;
}

/* Values — clear white */
.info-card .v-card__text .flex.xs8 {
    color: #ffffff !important;
}

.info-card a { color: #80cfff !important; }
.info-card a:hover { color: #b3e5fc !important; }

/* ----- Adaptive variant: when the sky behind the card is bright (daytime),
   make the backdrop nearly solid black so text always has sufficient
   contrast. JS toggles `.info-card--bright` based on canvas luminance. ----- */
.info-card--bright {
    background-color: rgba(8, 12, 18, 0.96) !important;
    background-image: linear-gradient(180deg,
            rgba(28, 36, 48, 0.4) 0%,
            rgba(8, 12, 18, 0.0) 100%) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.7),
        0 2px 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.info-card--bright h3,
.info-card--bright .v-card__text .flex.xs8 {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.info-card--bright .v-card__text .flex.xs4 {
    color: #c8d0d8 !important;
}

.info-card--bright .desc-block,
.info-card--bright .desc-block p {
    color: #f0f0f0 !important;
}

.info-card--bright a { color: #4fc3f7 !important; }

.info-card .v-card__text { padding-top: 8px; }

.desc-block {
    margin-top: 12px;
    line-height: 1.55;
    font-size: 13px;
    color: #e6e6e6;
}

.desc-block p {
    margin: 0 0 8px 0;
    white-space: pre-wrap;
}

.desc-thumb {
    float: right;
    margin: 0 0 8px 12px;
    max-width: 140px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.desc-source {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

.desc-source a { color: #80cfff; }

.name-list {
    font-size: 12px;
    color: #cccccc;
    margin-top: 6px;
}

.name-list .name-row { padding: 1px 0; }
.name-list .native { font-weight: 600; color: #ffffff; margin-right: 4px; }
.name-list .pron { color: #b3e5fc; }
.name-list .trans { color: #d7ccc8; font-style: italic; }

.stel-button-label {
    font-size: 11px;
    line-height: 1.2;
    margin-top: 2px;
    color: #e0e0e0;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
    user-select: none;
    white-space: nowrap;
}

.stel-button.semi-transparent .stel-button-label { color: #888; }

/* ===== AI assistant ===== */
.ai-drawer .v-navigation-drawer__content {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.ai-drawer .ai-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.ai-messages {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 120px;
    overflow-y: auto;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.ai-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    word-break: break-word;
    max-width: 92%;
    width: fit-content;
}

.ai-msg.user {
    background: #1565c0;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.ai-msg.assistant {
    background: #2a2a2a;
    color: #eee;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.ai-msg.tool {
    background: #1b262c;
    color: #b3e5fc;
    font-size: 11px;
    opacity: 0.85;
    margin-right: auto;
    padding: 4px 10px;
    max-width: 100%;
}

.ai-msg.tool details summary {
    cursor: pointer;
    list-style: none;
}

.ai-msg.tool details summary::-webkit-details-marker { display: none; }

.ai-msg.tool pre {
    margin: 4px 0 0 0;
    padding: 6px 8px;
    background: #0e1518;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    color: #c5e1f5;
}

.ai-msg.system {
    background: transparent;
    color: #888;
    font-style: italic;
    font-size: 11px;
    padding: 2px 6px;
}

.ai-msg .role {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 2px;
    letter-spacing: 0.04em;
}

/* Markdown rendering inside assistant bubbles. */
.ai-md p { margin: 0 0 6px 0; }
.ai-md p:last-child { margin-bottom: 0; }
.ai-md ul, .ai-md ol { margin: 4px 0 6px 18px; padding: 0; }
.ai-md li { margin: 1px 0; }
.ai-md h1, .ai-md h2, .ai-md h3, .ai-md h4 {
    margin: 8px 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.ai-md a { color: #80cfff; }
.ai-md code {
    background: #1a1a1a;
    color: #ffd479;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}
.ai-md pre {
    background: #111;
    padding: 8px 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 6px 0;
}
.ai-md pre code {
    background: transparent;
    padding: 0;
    color: #e6e6e6;
    font-size: 12px;
}
.ai-md blockquote {
    border-left: 3px solid #555;
    margin: 4px 0;
    padding-left: 10px;
    color: #ccc;
}
.ai-md table {
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 12px;
}
.ai-md table th, .ai-md table td {
    border: 1px solid #444;
    padding: 3px 6px;
}

.ai-msg .tool-summary {
    cursor: pointer;
    user-select: none;
}

.ai-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    background: #80cfff;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: ai-blink 1s steps(1) infinite;
}

@keyframes ai-blink {
    50% { opacity: 0; }
}

.ai-input-row {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px;
    border-top: 1px solid #333;
    background: #1e1e1e;
    z-index: 2;
    max-height: 120px;
    overflow: hidden;
}

.ai-empty {
    color: #888;
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    padding: 0 12px;
    line-height: 1.6;
}

/* ===== AI welcome card (local only, never sent to LLM) ===== */
.ai-welcome {
    padding: 6px 4px 12px 4px;
    color: #ddd;
}

.ai-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.ai-welcome-intro {
    font-size: 12.5px;
    line-height: 1.55;
    color: #bbb;
    margin: 0 0 10px 0;
}

.ai-welcome-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-chip {
    background: #263238;
    color: #e1f5fe;
    border: 1px solid #37474f;
    border-radius: 14px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    font-family: inherit;
}

.ai-chip:hover {
    background: #37474f;
    border-color: #4fc3f7;
}

.ai-chip:active {
    transform: translateY(1px);
}

/* ===== Settings drawer ===== */
.settings-drawer .settings-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px 10px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2a2a2a;
    background: linear-gradient(180deg, #1a2226 0%, #1e1e1e 100%);
}

.settings-drawer .settings-section {
    padding: 14px 16px 18px 16px;
}

.settings-drawer .settings-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #80cfff;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-drawer .settings-saved {
    margin-top: 8px;
    font-size: 11px;
    color: #4caf50;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Soften the v-text-field outline color in the settings drawer */
.settings-drawer .v-text-field--outlined fieldset {
    border-color: #3a3a3a;
}
.settings-drawer .v-text-field--outlined.v-input--is-focused fieldset {
    border-color: #4fc3f7;
}
