← back to Watches

public/pwa-styles.css

641 lines

/**
 * PWA Styles for Omega Watches
 * Mobile-first, responsive design with dark theme
 */

:root {
  --primary-color: #C41E3A;
  --secondary-color: #0C1E3C;
  --accent-color: #2e86ab;
  --background-dark: #0C1E3C;
  --background-darker: #0a1629;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --border-color: #2a3f5f;
  --success-color: #6a994e;
  --warning-color: #f18f01;
  --error-color: #bc4749;
  --card-bg: #1a2f50;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
}

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

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background-dark);
  color: var(--text-primary);
  font-size: 16px; /* Prevents iOS auto-zoom */
  line-height: 1.5;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  padding-bottom: 80px; /* Space for bottom nav */
}

/* Navigation */
.main-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  font-size: 32px;
  font-weight: bold;
}

.nav-title {
  font-size: 18px;
  font-weight: 600;
  display: none;
}

@media (min-width: 768px) {
  .nav-title {
    display: block;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px;
  z-index: 100;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  min-width: 70px;
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(196, 30, 58, 0.1);
}

.nav-item svg {
  opacity: 0.8;
  transition: opacity 0.3s;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-item span {
  font-size: 12px;
  font-weight: 500;
}

/* Buttons */
.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-icon:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:active {
  transform: scale(0.98);
  background: #a31830;
}

.btn-secondary {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

.btn-close {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

/* Banners */
.update-banner,
.install-banner {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--accent-color);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  z-index: 99;
  animation: slideDown 0.3s ease;
}

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

.update-content,
.install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.install-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.install-text {
  flex: 1;
}

.install-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.install-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.btn-install,
.btn-update {
  padding: 8px 16px;
  background: white;
  color: var(--accent-color);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-dismiss {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning-color);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 98;
  box-shadow: var(--shadow);
}

/* Views */
.view {
  display: none;
  min-height: calc(100vh - 130px);
}

.view.active {
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  margin-bottom: 32px;
  text-align: center;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Watch List */
.watches-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .watches-list {
    grid-template-columns: 1fr;
  }
}

/* Scanner View */
.scanner-container,
.ar-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
}

.scanner-header,
.ar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
}

.scanner-viewport,
.ar-viewport {
  position: relative;
  flex: 1;
  background: #000;
  overflow: hidden;
}

.scanner-viewport video,
.ar-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ar-viewport canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scan-frame {
  width: 280px;
  height: 140px;
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scan-instructions {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.8);
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.scanner-controls {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: var(--background-darker);
  justify-content: center;
}

.scanner-controls button {
  flex: 1;
  max-width: 150px;
}

/* AR Controls */
.ar-controls-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
}

.ar-btn {
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.ar-watch-selector {
  padding: 20px;
  background: var(--background-darker);
  border-top: 1px solid var(--border-color);
  max-height: 200px;
  overflow-y: auto;
}

.ar-watch-selector h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
}

.ar-watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.ar-watch-card {
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s;
}

.ar-watch-card:active {
  transform: scale(0.95);
}

.ar-watch-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border-color);
}

.ar-watch-card p {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Scan History */
.scan-history {
  padding: 20px;
  background: var(--background-darker);
  max-height: 200px;
  overflow-y: auto;
}

.scan-history h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 20px;
}

.empty-state p {
  margin: 8px 0;
  font-size: 16px;
}

.empty-state-hint {
  font-size: 14px;
  opacity: 0.7;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg,
    var(--card-bg) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--card-bg) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Touch Feedback */
@media (hover: none) {
  button:active {
    opacity: 0.8;
  }
}

/* Safe Area Insets (for notched devices) */
@supports (padding: max(0px)) {
  .main-nav {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  /* Already dark by default */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}