/* ============================================================
   Tools CSS — minimal additions on top of Ghost/Casper screen.css
   Ghost's screen.css is loaded first via CDN.
   Everything here uses Ghost's own color values.
   ============================================================ */

/* --- Tool Intro --- */
.tool-intro {
    margin-bottom: max(4vmin, 28px);
    font-size: 1.6rem;
    line-height: 1.7;
    color: #15171A;
}

.tool-intro h2 {
    font-size: 2.2rem;
    margin: 0 0 12px;
}

.tool-intro p {
    margin: 0 0 14px;
    color: #343f44;
}

.tool-intro ul {
    margin: 0 0 14px;
    padding-left: 22px;
}

.tool-intro li {
    margin-bottom: 8px;
    color: #343f44;
}

/* --- Info Icon & Tooltip --- */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e1e1e1;
    color: #738a94;
    font-size: 1.0rem;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.info-icon::before {
    content: "i";
}

.info-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 10px 14px;
    background: #15171A;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 5px;
    z-index: 100;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
}

.info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #15171A;
}

.info-icon:hover .info-tooltip,
.info-icon:focus .info-tooltip {
    display: block;
}

/* --- Tool Cards (styled like Ghost bookmark cards) --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: max(3.2vmin, 24px);
    margin-top: max(3.2vmin, 24px);
}

.tool-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    padding: 24px;
    text-decoration: none;
    color: #15171A;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.tool-card:hover {
    box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.15),
                0 0 1px rgba(0, 0, 0, 0.09);
    color: #15171A;
}

.tool-card-icon {
    font-size: 3.2rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tool-card h3 {
    font-size: 1.7rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #15171A;
}

.tool-card p {
    font-size: 1.4rem;
    line-height: 1.5;
    color: #738a94;
    margin: 0;
    flex-grow: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

.tool-card-arrow {
    display: block;
    margin-top: 14px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #15171A;
}

/* --- Tool Description --- */
.tool-description {
    color: #738a94;
    font-size: 1.8rem;
    line-height: 1.5;
    margin-bottom: max(3.2vmin, 24px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* --- Forms --- */
.tool-form {
    margin-bottom: max(3.2vmin, 24px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.form-section {
    margin-bottom: max(3.2vmin, 24px);
}

.form-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #738a94;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e1e1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #15171A;
}

.form-group .label-hint {
    font-weight: 400;
    color: #979797;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    height: 42px;
    padding: 8px 12px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    font-size: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    color: #15171A;
    background: #fff;
    transition: border-color 0.15s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #15171A;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 8px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    cursor: pointer;
    transition: opacity 0.15s;
    letter-spacing: -0.005em;
}

.btn:hover { opacity: 0.88; }

.btn-primary {
    background: #15171A;
    color: #fff;
}

/* --- Verdict Banner --- */
.verdict {
    padding: 16px 20px;
    border-radius: 5px;
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: max(3.2vmin, 24px);
}

.verdict-positive {
    background: #f0faf0;
    border: 1px solid #a4d037;
    color: #15171A;
}

.verdict-negative {
    background: #fdf2f2;
    border: 1px solid #f05230;
    color: #15171A;
}

/* --- Results --- */
.results-section {
    margin-top: max(3.2vmin, 24px);
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: max(3.2vmin, 24px);
}

.result-card {
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e1e1e1;
    background: #fff;
}

.result-card.ruerup {
    border-top: 3px solid #15171A;
}

.result-card.etf {
    border-top: 3px solid #a4d037;
}

.result-card-label {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #738a94;
    margin-bottom: 4px;
}

.result-card-value {
    font-size: 2.6rem;
    font-weight: 700;
    color: #15171A;
    letter-spacing: -0.02em;
}

.result-card-sub {
    font-size: 1.3rem;
    color: #979797;
    margin-top: 4px;
    line-height: 1.5;
}

/* --- Table --- */
.results-table-wrapper {
    overflow-x: auto;
    margin-top: max(2vmin, 16px);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.4rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

.results-table th {
    text-align: left;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    border-bottom: 2px solid #e1e1e1;
    color: #738a94;
    white-space: nowrap;
}

.results-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #15171A;
}

.results-table tbody tr:hover {
    background: #fafafa;
}

.results-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: Menlo, Courier, monospace;
    font-size: 1.3rem;
}

/* --- HTMX loading --- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request .btn-text {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Error --- */
.error-message {
    padding: 14px 18px;
    background: #fdf2f2;
    border: 1px solid #f05230;
    border-radius: 5px;
    color: #f05230;
    font-weight: 600;
    font-size: 1.4rem;
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .form-grid { grid-template-columns: 1fr; }
    .results-summary { grid-template-columns: 1fr; }
    .result-card-value { font-size: 2.2rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .info-tooltip {
        width: 220px;
        left: auto;
        right: -8px;
        transform: none;
    }
    .info-tooltip::after {
        left: auto;
        right: 12px;
        transform: none;
    }
}
