@import url('./variables.css');
@import url('./layout.css');
@import url('./components.css');

/* --- Mobile-First Specific Enhancements for SimplifyNumbers Studio --- */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  padding-bottom: calc(72px + var(--safe-bottom));
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
}

/* Touch-Optimized Primary Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:active {
  transform: scale(0.995);
}

/* Minimal Weekly Grid */
.weekly-days-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

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

@media (min-width: 1200px) {
  .weekly-days-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Touch Target Buttons */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12px;
}

/* Bottom Mobile Navigation Bar */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  width: 25%;
  height: 100%;
  transition: color 0.15s ease;
}

.mobile-nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--brand-blue);
}

/* Top Strip Metric Summary */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .metric-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.metric-pill-val {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-pill-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Responsive Modal Adjustments */
.modal-dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding: 0;
  width: 92%;
  max-width: 680px;
  margin: auto;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}
