:root {
    --bg-color: #333333;
    --card-bg: #121212;
    --border-color: #333333;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --green: #00e676;
    --red: #ff5252;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.dashboard-container {
    width: 100%;
    xxxmax-width: 1000px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

#last-update { font-size: 0.9rem; color: var(--text-muted); }

/* Mřížka dlaždic */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
    gap: 15px;
}

/* Velikosti dlaždic */
.tile {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.tile-1x1 { grid-column: span 1; grid-row: span 1; }
.tile-2x1 { grid-column: span 2; grid-row: span 1; }
.tile-1x2 { grid-column: span 1; grid-row: span 2; }
.tile-3x1 { grid-column: span 3; grid-row: span 1; }
.tile-3x2 { grid-column: span 3; grid-row: span 2; }

.widget {
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    box-sizing: border-box;
}

.keep-line {
  display: block;          /* or inline-block, but needs a defined width/container constraint */
  white-space: nowrap;     /* Prevents text from wrapping to the next line */
  overflow: hidden;        /* Hides any content that overflows the container */
  text-overflow: ellipsis; /* Replaces the overflowing text with an ellipsis (...) */
}

/* Styling obsahu widgetů */
.widget-title { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }
.temp-big { font-size: 4rem; font-weight: bold; }

.hourly-list, .daily-list { display: flex; justify-content: space-between; height: 100%; align-items: center; }
.hourly-item, .daily-item { text-align: center; flex: 1; }

.stock-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.stock-symbol { font-size: 1.4rem; font-weight: bold; }
.stock-price { font-size: 1.4rem; font-weight: normal; }
.positive { color: var(--green); }
.negative { color: var(--red); }

/* Velikost dlaždice 2x2 */
.tile-2x2 { 
    grid-column: span 2; 
    grid-row: span 2; 
}

/* Heatmap Grid pro 24 políček (6 sloupců × 4 řádky) */
.heatmap-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    height: calc(100% - 25px);
    margin-top: 6px;
}

.heatmap-box {
    border-radius: 4px;
    padding: 2px 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    overflow: hidden;
}

.heatmap-box .symbol { 
    font-size: 0.75rem; 
    line-height: 1;
    font-size: 1rem;
}

.heatmap-box .change { 
    font-size: 0.85rem; 
    opacity: 0.9; 
    margin-top: 2px;
}

/* Barvy pro Heatmapu - 3 úrovně pro plus i mínus */
.bg-green-strong { 
    background-color: #00e676; /* Jasně zelená (> 3%) */
    color: #000000;            /* Černý text pro kontrast */
    text-shadow: none;
}
.bg-green-medium { 
    background-color: #2e7d32; /* Středně zelená (1% až 3%) */
}
.bg-green-light  { 
    background-color: #1b4d20; /* Tmavě zelená (do 1%) */
}

.bg-neutral      { 
    background-color: #374151; /* Šedá (přesně 0%) */
}

.bg-red-light    { 
    background-color: #4a1515; /* Tmavě červená (do -1%) */
}
.bg-red-medium   { 
    background-color: #b71c1c; /* Středně červená (-1% až -3%) */
}
.bg-red-strong   { 
    background-color: #ff1744; /* Jasně neonově červená (< -3%) */
    color: #000000;            /* Černý text pro kontrast */
    text-shadow: none;
}
.bg-red-verystrong   { 
    background-color: #ff6080; /* Jasně neonově červená (< -3%) */
    color: #000000;            /* Černý text pro kontrast */
    text-shadow: none;
}


.transport-widget {
  position: relative !important;
  overflow: hidden !important;
}

.transport-widget::after {
  content: "\1F68C\FE0E"; /* Jednobarevný textový autobus (nežlutý) */
  position: absolute;
  right: 0px;
  bottom: -15px;
font-size: clamp(80px, 40% + 20px, 180px);
  color: #ffffff; /* Kombinace bílé barvy a nízké opacity vytvoří jemný šedý vodoznak */
  opacity: 0.2;  /* Maximální průhlednost, aby to nerušilo text */
  z-index: 0;     /* Umístí pod obsah */
  pointer-events: none; 
  line-height: 1;
}

/* Zajištění, aby vnitřní prvky widgetu byly nad tímto pozadím */
.transport-widget > * {
  position: relative;
  z-index: 1;
}


/* Styly pro widget kalendáře */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 25px);
    overflow: hidden; /* Co přeteče přes výšku dlaždice, to se schová */
    font-size: 0.85rem;
}

.cal-day-header {
    font-weight: bold;
    color: #93c5fd;
    margin-top: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #3b82f6; /* Čistá modrá čára přes celou šířku */
    padding-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trend-description {
    font-size: 0.7rem;
}


.cal-old {
    font-weight: 200;
    color: #93c4fd8b;

}

.cal-event-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    padding-left: 4px;
}

.cal-event-time {
    font-size: 1rem;
    color: #9ca3af; /* Šedivější čas */
}

.cal-event-title {
    /* font-weight: bold; */
    font-size: 1.0rem;
    color: #ffffff;
    white-space: nowrap;      /* Zamezí přechodu na další řádek */
    overflow: hidden;         /* Skryje přetékající text */
    text-overflow: ellipsis;  /* Přidá tečky (...) na konec */
}

.widget-bottom-title {
    display: flex; 
    justify-content: center; 
    background: rgba(255,255,255,0.11); 
    padding: 6px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    font-weight: 400; 
    text-align: center;
}

/* Fuel */

.fuel-widget {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fuel-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
}

.fuel-main-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 8px;
}

.fuel-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f3f4f6;
}

.fuel-currency {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-left: 4px;
}

.fuel-badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 2px;
    border-radius: 12px;
}

.fuel-badge.positive {
    background-color: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.fuel-badge.negative {
    background-color: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.period-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
    margin-bottom: 8px;
}

.fuel-chart-container {
    width: 100%;
    margin-top: auto;
}

/* Wind */

.wind-widget {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.wind-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.wind-visual {
    display: flex;
    align-items: center;
    gap: 16px;
}
.compass-rose {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8; /* Světle modrá pro vítr */
}
.main-speed {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}
.main-speed .unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: #94a3b8;
}
.wind-dir-label, .gusts {
    font-size: 0.85rem;
    color: #cbd5e1;
}
.gusts {
    color: #fca5a5; /* Jemně červená pro varování před nárazy */
}
.wind-outlook {
    font-size: 0.8rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    line-height: 1.3;
}


.radar-gif {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Přizpůsobí rozměr 2x1 rámečku */
    border-radius: 4px;
    margin-top: 1rem;
}

/* USER  */


.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.user-area {
  position: relative;
}

.auth-btn,
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 0.82rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.auth-btn:hover,
.user-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-avatar-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #334155;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 100;
}

.user-menu.open {
  display: block;
}

.user-menu-info {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #94a3b8;
  word-break: break-all;
}

.user-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  color: #f8fafc;
  font-size: 0.82rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}