/* * Mobile-First Styles for Outage Scheduler
 * Version: 3.3.0 (DOCS STYLING & UX TWEAKS)
 * Last updated: 2026-02-15
 */

/* ========================================
   БАЗОВІ НАЛАШТУВАННЯ
   ======================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

html,
body {
  height: 100%;
  width: 100%;
}

input,
select,
textarea,
button {
  font-size: 16px !important;
}

/* ========================================
   CSS ЗМІННІ
   ======================================== */

:root {
  --bg0: #06070b;
  --bg1: #0b0f1a;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --muted2: rgba(255, 255, 255, 0.54);
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke2: rgba(255, 255, 255, 0.16);
  --good: #48f59a;
  --bad: #ff5e7a;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  --shadow2: 0 12px 30px rgba(0, 0, 0, 0.35);
  --r2: 20px;
  --blur: 20px;
}

[data-theme="light"] {
  --bg0: #f5f7ff;
  --bg1: #ffffff;
  --text: rgba(10, 18, 60, 0.90);
  --muted: rgba(10, 18, 60, 0.66);
  --muted2: rgba(10, 18, 60, 0.55);
  --stroke: rgba(10, 18, 60, 0.10);
  --stroke2: rgba(10, 18, 60, 0.16);
  --shadow: 0 22px 55px rgba(20, 30, 80, 0.12);
  --shadow2: 0 12px 30px rgba(20, 30, 80, 0.10);
}

/* ========================================
   BODY & BACKGROUNDS
   ======================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg1);
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

[data-theme="light"] .bg-orbs {
  opacity: 0.3;
}

.orb {
  position: absolute;
  border-radius: 50%; 
  filter: blur(40px); 
  opacity: 0.4;
  transform: translateZ(0);
  will-change: transform; 
}

.o1 {
  width: 300px;
  height: 300px;
  left: -100px;
  top: 100px;
  background: rgba(120, 90, 255, 0.3);
}

.o2 {
  width: 350px;
  height: 350px;
  right: -100px;
  top: 50px;
  background: rgba(80, 255, 210, 0.25);
}

.o3 {
  width: 320px;
  height: 320px;
  left: 10%;
  bottom: -150px;
  background: rgba(255, 180, 90, 0.2);
}

@font-face {
  font-family: 'Roboto';
  src: url('/assets/Roboto-Regular.ttf') format('truetype');
  font-display: swap;
}

/* ========================================
   BUTTON INTERACTION STYLES
   ======================================== */

button {
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn, .subbtn, .btn-small, .icon-btn, .theme-toggle, .btn-pdf {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.btn:hover, .subbtn:hover, .btn-small:hover, .icon-btn:hover, .theme-toggle:hover, .btn-pdf:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.btn:active, .subbtn:active, .btn-small:active, .icon-btn:active, .theme-toggle:active, .btn-pdf:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

.btn:focus-visible, .subbtn:focus-visible, .btn-small:focus-visible, .icon-btn:focus-visible {
    outline: 2px solid var(--good);
    outline-offset: 2px;
}


/* ========================================
   TOPBAR
   ======================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}

[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.85); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(120, 90, 255, 0.35), rgba(80, 255, 210, 0.24));
  border: 1px solid var(--stroke2);
  box-shadow: var(--shadow2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.bolt {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(14px 14px at 55% 35%, rgba(255, 255, 255, 0.80), transparent 60%),
    radial-gradient(12px 12px at 42% 62%, rgba(255, 255, 255, 0.55), transparent 60%);
  animation: shimmer 2.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-6px); opacity: 0.82; }
  50% { transform: translateX(6px); opacity: 1; }
}

.brand-text { min-width: 0; flex: 1; }
.brand-text .title { font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text .subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.theme-toggle {
  flex-shrink: 0;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ========================================
   WRAP & CARD
   ======================================== */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  overflow-x: hidden;
}

.card {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--r2);
  box-shadow: var(--shadow2);
  overflow: hidden;
}

/* ========================================
   SELECTION SECTION (HERO)
   ======================================== */

.hero-section {
    padding: 24px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease-out;
}

.hero-header {
    text-align: center;
    margin-bottom: 24px;
}

.h1 { font-size: 24px; font-weight: 900; line-height: 1.2; margin-bottom: 8px; }
.p { font-size: 15px; color: var(--muted); line-height: 1.5; }

.hint {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.4;
  text-align: center;
  margin-top: 16px;
}

.group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.group {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
}

.gtitle { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.subs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.subbtn {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px 12px;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .subbtn { background: rgba(255, 255, 255, 0.6); }
.subbtn.selected {
  border-color: var(--good);
  background: rgba(72, 245, 154, 0.15);
  box-shadow: 0 0 0 4px rgba(72, 245, 154, 0.1);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-col-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================
   NAV BAR (COMPACT SELECTION)
   ======================================== */

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--stroke);
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-label { color: var(--muted); font-size: 14px; }
.nav-value { font-weight: 700; font-size: 16px; color: var(--good); }

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.btn-small:hover { background: rgba(255, 255, 255, 0.12); }

/* ========================================
   STATUS CARD
   ======================================== */

.status-card {
  border: 1px solid var(--stroke);
  border-radius: var(--r2);
  background: linear-gradient(135deg, rgba(120, 90, 255, 0.15), rgba(80, 255, 210, 0.1));
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1; /* Stretch to fill */
}

.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(72, 245, 154, 0.15);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.15); opacity: 1; }
}

.pill {
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.status-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0 20px 0;
}

.status-big {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lamp {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #666;
  flex-shrink: 0;
  transition: all 0.3s;
}
.lamp.on { background: #ffd94d; box-shadow: 0 0 16px rgba(255, 217, 77, 0.8); }
.lamp.off { background: #444; box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6); }

.status-sub {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
  margin-left: 32px; 
}

.status-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: flex-start; 
  gap: 8px;
  flex-wrap: wrap;
}

.mini-label { font-size: 13px; color: var(--muted); }
.mini-val { font-size: 13px; color: var(--text); font-weight: 500; }

/* ========================================
   TODAY CARD
   ======================================== */

.today-card {
  border: 1px solid var(--stroke);
  border-radius: var(--r2);
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  height: auto; 
}

.today-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.today-title { font-weight: 700; font-size: 15px; }

.btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}
.btn-icon { font-size: 16px; }

.windows { display: flex; flex-direction: column; gap: 8px; }

.win {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.win .time { font-weight: 700; font-size: 16px; }

.skeleton {
  border: 1px dashed var(--stroke2);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted2);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  font-size: 14px;
}

/* ========================================
   MODAL, MONTH & CALENDAR
   ======================================== */

.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 700px;
    max-height: 90vh; 
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background-color: var(--bg1) !important;
    border: 1px solid var(--stroke);
    border-radius: var(--r2);
    box-shadow: var(--shadow);
}

.modal-panel .month-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--stroke);
    flex-shrink: 0;
    background-color: var(--bg1);
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* HELP CONTENT FIXES FOR CODE BLOCKS */
.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
    color: var(--text); 
}
.help-content h1, .help-content h2, .help-content h3 { margin: 24px 0 16px; color: var(--text); line-height: 1.3; }
.help-content p, .help-content li { margin-bottom: 14px; line-height: 1.6; color: var(--muted); }
.help-content ul { padding-left: 20px; }

/* Inline Code - Styled like blocks now */
.help-content :not(pre) > code {
    background: #0d1117 !important; /* Dark Github-like background */
    color: #e6edf3 !important;      /* Light distinct text */
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    vertical-align: middle;
}

/* Block Code (Pre) */
.help-content pre {
    background-color: #0d1117 !important; 
    padding: 18px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.help-content pre code {
    background: transparent !important; 
    color: #e6edf3 !important;          
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px !important;
    font-weight: normal !important;
}

.help-content::-webkit-scrollbar { width: 6px; }
.help-content::-webkit-scrollbar-thumb { background: var(--stroke2); border-radius: 10px; }

.month { margin-top: 16px; padding: 16px; }

.month-head {
  display: flex;
  flex-flow: row wrap; 
  justify-content: space-between; 
  align-items: center; 
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 16px;
}

.month-title { font-weight: 700; font-size: 18px; line-height: 1.3; }
.month-sub { font-size: 14px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-left: auto; }

.month-picker {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px; color: var(--muted);
}
.month-picker input {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 8px;
  min-height: 40px;
}

.icon-btn, .btn-pdf {
  display: flex; align-items: center; justify-content: center;
  height: 56px; min-width: 56px;
  border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08); color: var(--text);
  padding: 0 12px;
}

.desktop-cal { display: none; }
.mobile-cal { display: flex; flex-direction: column; gap: 10px; }

.mday {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
}
.mday-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mday-date { font-weight: 700; font-size: 16px; }
.mday-wins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mchip {
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px; color: var(--muted);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted2);
}

.site-notice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
  max-width: 920px;
  margin: 0 auto;
}

.site-notice p {
  margin: 0;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .month-picker span { display: none; }
  .btn-pdf span:not(.btn-icon) { display: none; }
}

@media (min-width: 768px) {
  .group-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .wrap { padding: 24px; }
  .group-grid { grid-template-columns: repeat(3, 1fr); }
  
  /* GRID LAYOUT FOR DASHBOARD */
  .dashboard-grid {
    flex-direction: row;
    align-items: flex-start; /* Do not stretch, allow content height */
  }
  
  .dashboard-col-left {
    flex: 1;
    width: 50%;
  }

  .today-card {
    flex: 1;
    width: 50%;
    /* Ensure it has at least the height of the left column content if needed, 
       but usually auto is better here */
    min-height: 100%; 
  }

  /* Desktop Calendar */
  .desktop-cal { display: block; }
  .mobile-cal { display: none; }
  
  .calendar-head {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px;
  }
  .dow {
    text-align: center; font-size: 12px; color: var(--muted); padding: 8px;
    border: 1px solid var(--stroke); border-radius: 12px; background: rgba(255, 255, 255, 0.05);
  }
  .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .cell {
    border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.05);
    border-radius: 14px; padding: 10px; min-height: 100px;
    display: flex; flex-direction: column; gap: 6px;
  }
  .daynum { font-weight: 700; font-size: 15px; }
  .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .chip2 {
    font-size: 11px; border: 1px solid var(--stroke2); background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px; border-radius: 999px; color: var(--muted);
  }
}
