﻿/* ==========================
   USD Stock Tool
============================= */
:root {
--status-red: #e74c3c;
    --status-yellow: #f1c40f;
    --status-green: #2ecc71;
    --status-neutral: #cbd5e1;
    --status-ring: rgba(15, 23, 42, 0.08);
}

/* ==========================
   Tool Utilities
============================= */
.muted-555 {
    color: #556070;
    font-size: 14px;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-inline {
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* ==========================
   Legacy Layout
============================= */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "rate result"
        "mode guide";
    gap: 22px;
    margin-top: 30px;
    align-items: stretch;
}

.card-rate {
    grid-area: rate;
}

.card-result {
    grid-area: result;
}

.card-mode {
    grid-area: mode;
}

.card-guide {
    grid-area: guide;
}

/* ==========================
   Legacy Card UI
============================= */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    animation: rise 0.5s ease both;
    height: 100%;
}

.card.highlight {
    border: 1px solid rgba(15, 76, 92, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.card-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.card-header:hover {
    opacity: 0.7;
}

.card-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.card.collapsed .card-content {
    max-height: 0;
    opacity: 0;
}

.collapse-icon {
    display: inline-block;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
    line-height: 1;
}

.card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.hero-panel {
    background: #0f4c5c;
    color: #f8fafc;
    border-radius: 20px;
    padding: 20px 22px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 76, 92, 0.08);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.checklist {
    margin: 0;
    padding-left: 18px;
}

.checklist li {
    margin: 8px 0;
    color: #f8fafc;
}

/* ==========================
   Legacy Form Bits
============================= */
.field-group {
    margin-top: 12px;
    display: grid;
    gap: 6px;
}

.hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

/* ==========================
   Components - Result / Status
============================= */
#result {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px dashed rgba(15, 76, 92, 0.3);
    background: #f8fafc;
    border-radius: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 90px;
    font-family: "Sora", "Noto Sans TC", sans-serif;
    font-size: 14px;
}

.status-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    color: #3a475a;
}

.status-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 14px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    background: var(--status-neutral);
    box-sizing: border-box;
    border: 2px solid var(--status-ring);
}

.status-dot--lg {
    width: 14px;
    height: 14px;
    border-width: 3px;
}

.status-dot--sm {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.status-dot.is-red {
    background: var(--status-red);
}

.status-dot.is-yellow {
    background: var(--status-yellow);
}

.status-dot.is-green {
    background: var(--status-green);
}

/* ==========================
   Legacy Responsive
============================= */
@media (max-width: 960px) {
.content-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "rate"
            "mode"
            "result"
            "guide";
    }
}

/* ==========================
   Tool Layout
============================= */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 30px;
    align-items: stretch;
}

.input-panel,
.result-panel {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 20px;
    box-shadow: var(--shadow);
}

.input-panel {
    display: grid;
    align-content: start;
}

.result-panel {
    display: grid;
    align-content: start;
    gap: 16px;
}

/* ==========================
   Mode Toggle
============================= */
.mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mode-toggle button {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    transition: all 0.2s ease;
    box-shadow: none;
}

.mode-toggle button:hover {
    background: #f9fafb;
}

.mode-toggle button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 76, 92, 0.2);
}

/* ==========================
   Guide Panel
============================= */
.guide-panel {
    margin-top: 22px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow);
}

.guide-header {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guide-header:hover {
    opacity: 0.7;
}

.guide-content {
    margin-top: 12px;
    font-size: 14px;
    color: #555;
}

.guide-content p:first-child {
    margin-top: 0;
}

.guide-content p:last-child {
    margin-bottom: 0;
}

/* ==========================
   Result Summary
============================= */
.result-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-main {
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    font-family: "Sora", "Noto Sans TC", sans-serif;
    transition: color 0.2s ease;
}

.result-status-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
}

.result-status {
    font-size: 16px;
    font-weight: 600;
}

.result-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e5e7eb;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.card-mini {
    background: #f9fafb;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.card-mini .label {
    font-size: 12px;
    color: #6b7280;
}

.card-mini .value {
    font-size: 16px;
    font-weight: 700;
}

.status-green {
    color: var(--status-green);
}
.status-red {
    color: var(--status-red);
}
.status-yellow {
    color: var(--status-yellow);
}

.badge-green {
    background: rgba(46, 204, 113, 0.15);
    color: var(--status-green);
}
.badge-red {
    background: rgba(231, 76, 60, 0.15);
    color: var(--status-red);
}
.badge-yellow {
    background: rgba(241, 196, 15, 0.15);
    color: #b45309;
}

/* ==========================
   Responsive - Tool Layout
============================= */
@media (max-width: 768px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .mode-toggle button {
        padding: 12px;
        font-size: 14px;
    }

    .result-main {
        font-size: 42px;
    }
}
