/* Tiptop Safety Demo — Shared Styles */

:root {
  --primary: #1E3A5F;
  --primary-light: #2A4A73;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #E2E8F0;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Desktop wrapper: card left, phone right */
.desktop-wrapper {
  display: contents;
}

/* Business card — hidden on mobile */
.business-card {
  display: none;
}

/* Phone frame on desktop */
.phone-frame {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  body {
    align-items: center;
    padding: 24px 0;
    background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%);
  }

  .desktop-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
    justify-content: center;
  }

  .business-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 340px;
    animation: fadeIn 0.5s ease-out;
  }

  .business-card .bc-logo {
    height: 32px;
    width: auto;
    margin-top: 24px;
  }

  .business-card .bc-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 28px;
    border: 4px solid white;
  }

  .business-card .bc-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 8px;
  }

  .business-card .bc-name {
    font-size: 28px;
    font-weight: 800;
    color: #FE3056;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .business-card .bc-role {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 28px;
  }

  .business-card .bc-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .business-card .bc-contact a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.15s;
  }

  .business-card .bc-contact a:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
  }

  .business-card .bc-contact a svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
  }

  .business-card .bc-tagline {
    margin-top: 32px;
    font-size: 13px;
    color: #94A3B8;
    line-height: 1.5;
  }

  .business-card .bc-tagline strong {
    color: var(--primary);
  }

  .phone-frame {
    min-height: 0;
    height: 844px;
    border-radius: 40px;
    box-shadow:
      0 0 0 12px #1a1a1a,
      0 0 0 14px #333,
      0 25px 60px rgba(0, 0, 0, 0.3);
    overflow-x: hidden;
    flex-shrink: 0;
  }
  .phone-frame::-webkit-scrollbar {
    display: none;
  }
  .phone-frame {
    scrollbar-width: none;
  }
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background-color: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  z-index: 50;
}

.status-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-bar-right svg {
  width: 16px;
  height: 16px;
}

/* Bottom navigation */
.bottom-nav {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  flex-shrink: 0;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  transition: color 0.2s;
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
}

/* Page content area */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0;
  animation: fadeIn 0.3s ease-out;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.page-content::-webkit-scrollbar {
  display: none;
}

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

/* Header */
.page-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px 20px;
}

.page-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header-title a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.page-header-title h1 {
  font-size: 20px;
  font-weight: 700;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 16px;
  margin-bottom: 12px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.badge-accent {
  background: var(--accent);
  color: white;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-muted {
  background: #F1F5F9;
  color: var(--text-muted);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

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

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

/* Input */
.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
}

.input-field::placeholder {
  color: #94A3B8;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  flex: 1;
  color: var(--text);
}

.search-bar input::placeholder {
  color: #94A3B8;
}

.search-bar svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #FBBF24);
  transition: width 0.5s ease;
}

/* Document list item */
.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-icon.pdf {
  background: #FEE2E2;
  color: #DC2626;
}

.doc-icon.word {
  background: #DBEAFE;
  color: #2563EB;
}

.doc-icon.form {
  background: #D1FAE5;
  color: #059669;
}

.doc-item-info {
  flex: 1;
  min-width: 0;
}

.doc-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-item-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.doc-item-action {
  flex-shrink: 0;
  color: var(--text-muted);
}

.doc-item-action svg {
  width: 20px;
  height: 20px;
}

/* Training card */
.training-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}

.training-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 28px;
}

.training-info {
  flex: 1;
  min-width: 0;
}

.training-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.training-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Profile sections */
.profile-section {
  margin-bottom: 20px;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
  border-bottom: none;
}

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

.profile-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* Notification item */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-dot.read {
  background: #CBD5E1;
}

.notif-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.notif-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Certificate item */
.cert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}

.cert-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-info {
  flex: 1;
}

.cert-title {
  font-size: 15px;
  font-weight: 600;
}

.cert-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
