/* HAM4LIFE live station card (ported look from the WP plugin) */
.n1mm-card {
    width: 300px;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.15);
    padding: 14px;
    background: #141b23;
    color: #e8edf2;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.35);
    font-family: ui-monospace, "Cascadia Code", Consolas, "DejaVu Sans Mono", "Courier New", monospace;
}
.n1mm-title { text-align: center; font-weight: 700; margin-bottom: 6px; color: #7dd3fc; }
.n1mm-status {
    text-align: center; font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: #7a828b;
}
.n1mm-onair .n1mm-status {
    color: #ff2b2b;
    text-shadow: 0 0 6px rgba(255, 43, 43, 0.9), 0 0 14px rgba(255, 43, 43, 0.6);
    animation: n1mm-onair-pulse 1.6s ease-in-out infinite;
}
@keyframes n1mm-onair-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(255, 43, 43, 0.95), 0 0 16px rgba(255, 43, 43, 0.7); }
    50%      { opacity: 0.6; text-shadow: 0 0 3px rgba(255, 43, 43, 0.4), 0 0 7px rgba(255, 43, 43, 0.25); }
}
@media (prefers-reduced-motion: reduce) { .n1mm-onair .n1mm-status { animation: none; } }
.n1mm-rows { display: block; }

/* Show only the rows that belong to the current card mode.
   card-mode-* is set at render (server hint) and updated live by card.js. */
.n1mm-card.card-mode-n1mm .field-minibook { display: none; }
.n1mm-card.card-mode-minibook .field-n1mm { display: none; }
/* HRD sends only the shared fields (call/op, freq, band, mode, radio) — hide the
   N1MM-only and MiniBook-only rows. */
.n1mm-card.card-mode-hrd .field-n1mm,
.n1mm-card.card-mode-hrd .field-minibook { display: none; }
/* Log4OM sends RadioInfo (operator, freq, band, mode) + a worked call. Hide the
   N1MM/MiniBook-only rows and the fields Log4OM never provides (callsign, radio);
   "Last worked" is an optional row and still shows when a value is present. */
.n1mm-card.card-mode-log4om .field-n1mm,
.n1mm-card.card-mode-log4om .field-minibook,
.n1mm-card.card-mode-log4om .n1mm-field-mycall,
.n1mm-card.card-mode-log4om .n1mm-field-radio { display: none; }

/* Optional rows (e.g. N1MM worked call / event) show only when they have a
   value — card.js adds .has-value. */
.n1mm-row.optional:not(.has-value) { display: none; }
.n1mm-row { display: flex; justify-content: space-between; font-size: 0.95rem; margin: 4px 0; }
.n1mm-label { color: #9aa7b2; font-weight: 600; margin-right: 10px; white-space: nowrap; }
.n1mm-value { color: #fff; font-weight: 500; text-align: right; flex: 1; }
.n1mm-footer { margin-top: 10px; text-align: center; font-size: 0.7rem; color: #7f8994; }
.n1mm-foot-update { display: inline-flex; align-items: center; gap: 4px; }
.n1mm-refresh { flex: 0 0 auto; opacity: .85; }
.n1mm-refresh.spin { animation: n1mm-spin .6s ease; }
@keyframes n1mm-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .n1mm-refresh.spin { animation: none; } }

/* Horizontal layout (default): a compact bar spanning the width. As more data
   is added the fields wrap onto a 2nd line; vertical spacing is kept minimal. */
.n1mm-style-horizontal {
    width: 100%; max-width: none; box-sizing: border-box;
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px 14px; padding: 8px 14px;
}
.n1mm-style-horizontal .n1mm-title {
    margin: 0; font-size: .95rem; white-space: nowrap; flex: 0 0 auto;
}
.n1mm-style-horizontal .n1mm-status {
    margin: 0; font-size: .9rem; white-space: nowrap; flex: 0 0 auto;
}
.n1mm-style-horizontal .n1mm-rows {
    display: flex; flex: 1 1 auto; flex-wrap: wrap;
    justify-content: space-between; gap: 2px 14px; min-width: 0; align-content: center;
}
.n1mm-style-horizontal .n1mm-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; min-width: 0;
}
.n1mm-style-horizontal .n1mm-label {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .03em; margin: 0; line-height: 1.3;
}
.n1mm-style-horizontal .n1mm-value {
    text-align: left; font-size: .9rem; line-height: 1.3; white-space: nowrap;
}
.n1mm-style-horizontal .n1mm-footer { margin: 0; white-space: nowrap; flex: 0 0 auto; }
.n1mm-style-horizontal .n1mm-foot-update { font-size: .65rem; }

/* Compact layout */
.n1mm-style-compact { width: 240px; padding: 10px; }
.n1mm-style-compact .n1mm-status { font-size: 1rem; margin-bottom: 8px; }
.n1mm-style-compact .n1mm-row { font-size: 0.85rem; }

/* Text layout: emphasize values */
.n1mm-style-text .n1mm-label { font-size: 0.8rem; }
.n1mm-style-text .n1mm-value { font-weight: 700; }

/* Frequency stands out in neon green with a soft glow. */
.n1mm-field-freq .n1mm-value {
    color: #39ff14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.7), 0 0 12px rgba(57, 255, 20, 0.4);
    font-weight: 700;
    letter-spacing: .02em;
}
/* Last-worked callsign: pulsing neon yellow with glow. */
.n1mm-field-call .n1mm-value {
    color: #fff44f;
    font-weight: 700;
    animation: n1mm-pulse 1.6s ease-in-out infinite;
}
@keyframes n1mm-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(255, 234, 0, 0.95), 0 0 16px rgba(255, 234, 0, 0.7); }
    50%      { opacity: 0.55; text-shadow: 0 0 3px rgba(255, 234, 0, 0.4), 0 0 7px rgba(255, 234, 0, 0.25); }
}
@media (prefers-reduced-motion: reduce) {
    .n1mm-field-call .n1mm-value {
        animation: none;
        text-shadow: 0 0 6px rgba(255, 234, 0, 0.9), 0 0 14px rgba(255, 234, 0, 0.6);
    }
}

/* Band = neon orange. */
.n1mm-field-band .n1mm-value {
    color: #ff9d2f;
    text-shadow: 0 0 6px rgba(255, 157, 47, 0.7), 0 0 12px rgba(255, 157, 47, 0.4);
    font-weight: 700;
    letter-spacing: .02em;
}
/* Mode = neon cyan. */
.n1mm-field-mode .n1mm-value {
    color: #2bf5ff;
    text-shadow: 0 0 6px rgba(43, 245, 255, 0.7), 0 0 12px rgba(43, 245, 255, 0.4);
    font-weight: 700;
    letter-spacing: .02em;
}

/* On narrow screens force the normal (vertical) card, whatever style was chosen.
   The horizontal single-line bar doesn't fit a phone in portrait. */
@media (max-width: 640px) {
    .n1mm-card { width: 100%; max-width: 100%; }
    .n1mm-style-horizontal {
        display: block; padding: 14px; gap: 0; overflow: visible;
    }
    .n1mm-style-horizontal .n1mm-title { margin: 0 0 6px; font-size: 1rem; white-space: normal; }
    .n1mm-style-horizontal .n1mm-status { margin: 0 0 12px; font-size: 1.15rem; white-space: normal; }
    .n1mm-style-horizontal .n1mm-rows { display: block; }
    .n1mm-style-horizontal .n1mm-row {
        flex-direction: row; justify-content: space-between; align-items: baseline; margin: 4px 0;
    }
    .n1mm-style-horizontal .n1mm-label {
        font-size: 0.95rem; text-transform: none; letter-spacing: normal; line-height: 1.5;
    }
    .n1mm-style-horizontal .n1mm-value { text-align: right; font-size: 0.95rem; white-space: normal; }
    .n1mm-style-horizontal .n1mm-footer { margin-top: 10px; }
    .n1mm-style-compact { width: 100%; }
}

/* Theme is permanent dark — base styles above already carry the dark look. */

/* Rounder frames + a red neon halo around the whole card when ON AIR. */
.n1mm-card {
    border-radius: 16px;
    transition: box-shadow .3s ease, border-color .3s ease;
}
.n1mm-card.n1mm-onair {
    border-color: rgba(56, 189, 248, .55);
    box-shadow: 0 0 18px rgba(56, 189, 248, .30), 0 0 46px rgba(56, 189, 248, .15),
                0 6px 20px rgba(0, 0, 0, .45);
}
