/* DoraOS V6.7.2 – globalni stilovi */

:root {
  --bg: #050816;
  --bg-card: #070b1f;
  --bg-card-soft: #0c1024;
  --accent-blue: #4b7cff;
  --accent-purple: #a855f7;
  --accent-pink: #fb7185;
  --accent-green: #22c55e;
  --accent-orange: #f59e0b;
  --accent-grey: #6b7280;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --radius-lg: 22px;
  --radius-xl: 26px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.5);
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
  --danger: #ef4444;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body.app-shell {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #1d2b64 0, transparent 55%),
    radial-gradient(circle at bottom right, #182848 0, transparent 60%),
    linear-gradient(135deg, #020617, #020617 40%, #020617);
  color: var(--text-main);
}

/* Top bar */

.top-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #020617;
  box-shadow: var(--shadow-subtle);
  object-fit: contain;
  padding: 4px;
}

.app-title-wrap {
  display: flex;
  flex-direction: column;
}

.app-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.app-subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.clock {
  font-variant-numeric: tabular-nums;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: var(--shadow-subtle);
  font-size: 0.9rem;
}

.icon-button {
  border: none;
  outline: none;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(30, 64, 175, 0.95);
}

/* Main layout */

.layout-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 20px 28px;
}

/* Cards */

.card {
  background: radial-gradient(circle at top left, #0b1120, #020617 55%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.section-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.section-subtitle {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.section-subtitle.small {
  font-size: 0.8rem;
}

/* Menu tiles */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 112px);
  gap: 12px;
}

.menu-tile {
  border-radius: 20px;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  color: white;
  font-size: 1rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-med), box-shadow var(--transition-med), filter var(--transition-med);
}

.menu-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity var(--transition-med);
}

.menu-tile .tile-emoji {
  font-size: 1.5rem;
}

.menu-tile .tile-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.menu-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.85);
  filter: brightness(1.05);
}

.menu-tile:hover::after {
  opacity: 1;
}

.tile-blue {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.tile-purple {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.tile-pink {
  background: linear-gradient(135deg, #fb7185, #f97316);
}

.tile-green {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}

.tile-orange {
  background: linear-gradient(135deg, #f97316, #eab308);
}

.tile-grey {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

/* Confirm meds */

.confirm-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.big-confirm {
  border-radius: 999px;
  border: none;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  color: #ecfdf5;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-med), box-shadow var(--transition-med), filter var(--transition-med);
}

.big-confirm:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 20px 55px rgba(16, 185, 129, 0.6);
}

.btn-green {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.btn-blue {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

/* Meds table */

.meds-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9rem;
}

.meds-table th,
.meds-table td {
  padding: 6px 6px;
  text-align: center;
}

.meds-table th:first-child {
  text-align: left;
  padding-left: 2px;
}

.meds-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.65);
}

.meds-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.45);
}

.meds-table thead {
  background: rgba(15, 23, 42, 0.9);
}

.meds-table th {
  font-weight: 600;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.dot-green {
  background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e);
}

.dot-red {
  background: radial-gradient(circle at 30% 30%, #fecaca, #ef4444);
}

.dot-yellow {
  background: radial-gradient(circle at 30% 30%, #fef9c3, #eab308);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Footer */

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(90%, 420px);
  background: #020617;
  border-radius: 24px;
  padding: 18px 18px 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.pin-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text-main);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-med);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.9);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fef2f2;
}

.btn-danger:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-subtle);
}

.btn-outline {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: var(--text-main);
}

/* Sub pages */

.sub-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px 0;
}

.back-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-subtle);
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

textarea,
input[type="time"],
input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 8px 9px;
  background: #020617;
  color: var(--text-main);
  resize: vertical;
}

textarea {
  min-height: 96px;
}

/* Photos */

.photo-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.photo-grid img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Weather page */

.weather-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
  gap: 18px;
}

.weather-current {
  background: radial-gradient(circle at top left, #1d4ed8, #020617 65%);
  border-radius: 22px;
  padding: 16px 18px;
}

.weather-current-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.weather-icon {
  font-size: 2.5rem;
}

.weather-temp {
  font-size: 2.1rem;
  font-weight: 700;
}

.weather-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}

.weather-details dt {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.weather-details dd {
  margin: 2px 0 0;
  font-size: 0.95rem;
}

.weather-forecast {
  background: radial-gradient(circle at top right, #22c55e, #020617 65%);
  border-radius: 22px;
  padding: 16px 18px 14px;
}

.forecast-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.forecast-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 900px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, 110px);
  }

  .weather-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .confirm-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    padding: 14px 14px 16px;
  }

  .menu-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(6, 96px);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
