/* LOOGS Mobile PWA — Material Design 3 Mobile Design System */

:root {
  --md-sys-color-primary: #006494;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #cbe6ff;
  --md-sys-color-on-primary-container: #001e30;
  
  --md-sys-color-secondary: #0b4f6c;
  --md-sys-color-secondary-container: #d0e4f7;
  --md-sys-color-on-secondary-container: #001d2d;
  
  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #1e293b;
  --md-sys-color-surface-container: #f8fafc;
  --md-sys-color-surface-container-high: #f1f5f9;
  
  --md-sys-color-outline: #cbd5e1;
  --md-sys-color-outline-variant: #e2e8f0;
  
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-success: #16a34a;
  --md-sys-color-warning: #ea580c;
  
  --mobile-bottom-nav-height: 64px;
  --mobile-top-bar-height: 56px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f1f5f9;
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Mobile App Shell Layout */
.mobile-app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--md-sys-color-surface);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
}

/* Splash Screen Component */
.mobile-splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(145deg, #001e30 0%, #006494 60%, #0b4f6c 100%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ffffff;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-logo-circle {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: #ffffff;
  color: #006494;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: splashPulse 2s infinite alternate ease-in-out;
}

@keyframes splashPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  100% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(255,255,255,0); }
}

.splash-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 32px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Login View */
.mobile-login-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 24px;
  animation: fadeInView 0.3s ease-out;
}

/* Mobile Top App Bar */
.mobile-top-bar {
  height: var(--mobile-top-bar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  color: var(--md-sys-color-primary);
}

.mobile-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--md-sys-color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
}

/* Offline Status Indicator Pill */
.offline-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.status-online {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-offline {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  animation: pulseOffline 2s infinite;
}

@keyframes pulseOffline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Main Scrollable Viewport */
.mobile-content-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: calc(var(--mobile-bottom-nav-height) + 24px);
  -webkit-overflow-scrolling: touch;
}

.mobile-tab-view {
  display: none;
  animation: fadeInView 0.2s ease-out;
}

.mobile-tab-view.active {
  display: block;
}

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

/* MD3 Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  height: var(--mobile-bottom-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 4px;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.bottom-nav-item .material-symbols-outlined {
  font-size: 22px;
  padding: 2px 14px;
  border-radius: 100px;
  transition: all 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

.bottom-nav-item.active .material-symbols-outlined {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* Mobile Card Components */
.mobile-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.mobile-card-elevated {
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

/* Mobile Buttons */
.mobile-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 48px;
}

.mobile-btn:active {
  transform: scale(0.98);
}

.mobile-btn-primary {
  background: var(--md-sys-color-primary);
  color: #ffffff;
}

.mobile-btn-secondary {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.mobile-btn-outlined {
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  color: #334155;
}

.mobile-btn-warning {
  background: var(--md-sys-color-warning);
  color: #ffffff;
}

/* Mobile Form Inputs */
.mobile-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline);
  font-size: 14px;
  background: #ffffff;
  color: var(--md-sys-color-on-surface);
  margin-top: 4px;
  min-height: 46px;
  user-select: auto;
}

.mobile-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(0,100,148,0.15);
}

/* Bottom Sheet Modal Overlay */
.mobile-bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.mobile-bottom-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  padding: 18px;
  overflow-y: auto;
  animation: slideUpSheet 0.25s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 4px;
  margin: 0 auto 14px auto;
}
