/* FILE: assets/css/compact-redesign.css
   Compact visual redesign only. No selectors/IDs used by JavaScript have been changed. */

:root {
  --bg: #070b12;
  --panel: #0b111b;
  --panel-2: #0f1724;
  --line: rgba(148, 163, 184, .18);
  --text: #eef5ff;
  --muted: #9aa8bc;
  --blue: #38a6ff;
  --red: #ff4d4d;
  --green: #22c55e;
  --yellow: #ffd34d;
  --compact-radius: 12px;
}

html { background: var(--bg); }

body {
  font-size: 14px;
  line-height: 1.35;
  background:
    radial-gradient(circle at 18% -10%, rgba(56,166,255,.16), transparent 38%),
    radial-gradient(circle at 86% 0%, rgba(255,77,77,.10), transparent 30%),
    linear-gradient(180deg, #08101b 0%, #05070a 55%, #040609 100%);
}

.page-scale { max-width: 1880px; margin: 0 auto; }

/* Header: slimmer, more dashboard-like */
.topbar {
  min-height: 74px;
  padding: 8px 18px;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  background-image:
    linear-gradient(90deg, rgba(3,7,13,.92), rgba(3,7,13,.56), rgba(3,7,13,.92)),
    url("/images/header.png");
  filter: none;
  border-bottom: 1px solid rgba(56,166,255,.28);
}

.header-divider {
  height: 2px;
  margin-top: 0;
  opacity: .82;
}

.header-divider + * { margin-top: 0; }

.header-left { padding-bottom: 0; }

.header-left p {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .8px;
  opacity: .92;
}

.site-rating-box {
  margin-left: 0;
  min-width: 0;
}

.site-rating-stars {
  font-size: 24px;
  letter-spacing: 3px;
}

.header-logo img {
  max-height: 66px;
  filter: drop-shadow(0 0 12px rgba(56,166,255,.55));
  animation: none;
}

.clock {
  min-width: 142px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(5, 12, 22, .74);
  backdrop-filter: blur(6px);
}

.clock span { font-size: 24px; margin-bottom: 1px; }
.clock small { font-size: 11px; }

/* Layout: tighter columns and spacing */
.layout {
  grid-template-columns: 255px minmax(0, 1fr) 255px;
  gap: 10px;
  padding: 10px;
}

.side-panel { gap: 10px; }

.card,
.notice,
.main-board {
  border-radius: var(--compact-radius);
  background: linear-gradient(180deg, rgba(15,23,36,.92), rgba(8,13,21,.92));
  border-color: rgba(148,163,184,.16);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.notice { padding: 10px !important; }

.main-board {
  padding: 10px;
  border-color: rgba(56,166,255,.55);
  box-shadow: 0 0 0 1px rgba(56,166,255,.08), 0 10px 24px rgba(0,0,0,.30);
}

.section-title {
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.section-title h2 {
  font-size: 18px;
  letter-spacing: 2px;
}

.section-title span {
  padding: 5px 9px;
  font-size: 11px;
}

.board-login-btn {
  min-width: 88px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: .6px;
}

/* DOWNLOAD BUTTON */
.download-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(125, 183, 255, .85);
    background: linear-gradient(180deg, rgba(47, 129, 247, .18), rgba(47, 129, 247, .08));
    text-decoration: none;
    text-align: center;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: 1px;
    color: #d8eaff;
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0 0 6px rgba(47, 129, 247, .65);
    box-shadow:
        0 0 10px rgba(47, 129, 247, .24),
        inset 0 0 12px rgba(47, 129, 247, .06);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        color .2s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 16px rgba(47, 129, 247, .45),
        inset 0 0 14px rgba(47, 129, 247, .12);
    color: #ffffff;
}

/* Alert cards: compact, readable tiles */
.alerts {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 9px;
}

.alert-card {
  grid-template-columns: 52px 1fr;
  height: 168px;
  min-height: 168px;
  border-left-width: 5px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(13,24,37,.96), rgba(8,16,27,.96));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat) 16%, transparent), 0 8px 18px rgba(0,0,0,.24);
}

.alert-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat) 30%, transparent), 0 10px 22px rgba(0,0,0,.30);
}

.alert-left { gap: 4px; padding: 4px 3px; }
.cat-icon { width: 38px; height: 38px; }
.cat-name { font-size: 8px; letter-spacing: .25px; }

.alert-body {
  padding: 7px 8px;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 5px 7px;
}

.alert-head { gap: 6px; }
.alert-head h3 { font-size: 14px; line-height: 1.12; }
.priority { font-size: 8px; padding: 2px 6px; }

.location,
.ngr,
.details,
.units-list {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.16;
}

.alert-section { margin-top: 4px; }
.alert-section h4 { margin-bottom: 2px; font-size: 10px; }

.details {
  -webkit-line-clamp: 4;
  max-height: 51px;
}

.units-list {
  -webkit-line-clamp: 1;
  max-height: 14px;
}

.alert-preview {
  width: 132px;
  height: 118px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.08);
}

.alert-image { border-radius: 8px; }

.meta {
  padding-top: 3px;
  font-size: 9px;
  gap: 6px;
  border-top: 1px solid rgba(148,163,184,.12);
}

.meta-more { font-size: 8px; }

/* Compact side widgets */
.chat-open-text,
.incident-map-open-text,
.support-text,
.advert-text p,
.advert-extra,
.weather-updated,
.msg { font-size: 12px; }

.chat-head strong,
.incident-map-open-box strong,
.support-box strong,
.community-links-box strong,
.useful-links strong,
.reviews-box h2 { font-size: 14px !important; letter-spacing: .4px; }

button,
.support-btn,
.advert-call-btn,
.advert-website,
.incident-map-open-btn,
.chat-popup-open-btn,
.reviews-box button {
  border-radius: 8px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
}

input,
select,
textarea {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.weather-main { gap: 8px !important; }
.weather-main-icon { width: 52px !important; height: 52px !important; }
.weather-temp { font-size: 26px !important; }
.weather-range { font-size: 12px !important; }
.weather-row { padding: 5px 0 !important; font-size: 12px !important; }
.weather-row img { width: 18px !important; height: 18px !important; }

.lifeboat-header-img,
.rnli-latest-header-img { min-height: 52px !important; }
.lifeboat-launch-row,
.rnli-meta-box { padding: 5px 7px !important; }

.community-links-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; align-items: center; }
.community-links-box strong { grid-column: 1 / -1; }
.community-links-box img { max-height: 30px; margin: 0 auto; }

.useful-links a { padding: 5px 0 !important; font-size: 12px !important; }

#reviewsList { max-height: 330px; overflow-y: auto; padding-right: 3px; }
.review-card,
.review-item { padding: 8px !important; border-radius: 10px !important; }

/* Popups keep same behaviour, just denser */
.chat-popup-panel,
.incident-map-panel,
.member-account-panel,
.member-box {
  border-radius: 14px !important;
  background: rgba(8,13,21,.96) !important;
}

.chat-messages { max-height: 58vh; }
.chat-message { padding: 8px !important; }

/* Single alert page */
.single-alert-wrap { max-width: 980px !important; }
.single-alert {
  border-radius: 14px !important;
  padding: 16px !important;
  background: linear-gradient(180deg, rgba(15,23,36,.96), rgba(8,13,21,.96)) !important;
}
.single-alert h1 { font-size: 24px; }
.single-alert p { line-height: 1.35 !important; }

@media (max-width: 1320px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr) 230px; }
  .alerts { grid-template-columns: 1fr; }
  .alert-card { height: 158px; min-height: 158px; }
}

@media (max-width: 980px) {
  .layout { gap: 10px; padding: 10px; }
  .topbar { min-height: 92px; }
  .header-logo img { max-height: 72px; }
  .alerts { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar {
    height: 132px !important;
    min-height: 132px !important;
    background-position: center !important;
  }

  .header-logo { top: 25px !important; }
  .header-logo img { width: 78px !important; height: 78px !important; }
  .brand-rating-row { bottom: 6px !important; left: 8px !important; width: 43% !important; }
  .site-rating-stars { font-size: 18px !important; letter-spacing: 1px !important; }
  .header-right { bottom: 6px !important; right: 8px !important; width: 45% !important; }
  .clock { max-width: 132px !important; padding: 4px 6px !important; }
  #clockTime { font-size: 20px !important; }
  #clockDate { font-size: 8px !important; }

  .layout { padding: 8px !important; gap: 8px !important; }
  .main-board { padding: 8px !important; }
  .notice { padding: 8px !important; }

  .section-title { justify-content: space-between; gap: 6px; }
  .section-title h2 { font-size: 16px !important; letter-spacing: 1px !important; }
  .board-login-btn { min-width: 82px !important; padding: 5px 7px !important; }

  .alert-card {
    grid-template-columns: 50px 1fr !important;
    min-height: 118px !important;
    border-radius: 10px !important;
  }
  .cat-icon { width: 34px !important; height: 34px !important; }
  .alert-body { padding: 6px !important; }
  .alert-head h3 { font-size: 12px !important; }
  .details { -webkit-line-clamp: 3 !important; max-height: 44px !important; }
  .alert-preview { height: 78px !important; border-radius: 8px !important; }
  .meta { font-size: 8px !important; }
  .meta-more { display: none; }
}