/* Vodacom NxtGen - Shared Styles */
/* Mobile-first design */

:root {
  /* Brand Colors */
  --primary: #e60000;
  --primary-dark: #820000;
  --inactive: #4A4D4E;
  --text: #25282B;
  --text-light: #4A4D4E;
  --white: #FFFFFF;
  
  /* Accent Colors */
  --accent-purple: #5E2750;
  --accent-orange: #EB6100;
  --accent-teal: #0096AD;
  --accent-yellow: #FECB00;
  --accent-green: #008A00;
  --accent-pink: #9C2AA0;
  --accent-red: #BD0000;
  --accent-blue: #005EA5;
  
  /* State Colors */
  --error: #BD0000;
  --focus: #0096AD;
  --incomplete: #BEBEBE;
  --info: #005EA5;
  --success: #008A00;
  --warning: #EB6100;
  
  /* Gradients */
  --gradient-primary: linear-gradient(45deg, rgba(130,0,0,1) 0%, rgba(230,0,0,1) 100%);
  --gradient-secondary: linear-gradient(45deg, rgba(34,34,34,1) 0%, rgba(37,40,43,1) 100%);
  
  /* Spacing (8-point grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 50%;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection in form inputs */
input, textarea, select {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 24px; }
h2 { font-size: 22px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p {
  font-size: 16px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* App Container */
.app-container {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

/* Header */
.header {
  background: var(--gradient-primary);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}

.header-title {
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.header-left, .header-right {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon {
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-md);
  padding-bottom: 80px; /* Space for bottom nav */
}

/* Bottom Tab Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-sm) 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
  color: var(--inactive);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.nav-item-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.nav-item-label {
  font-weight: 500;
}

/* Cards */
.card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

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

/* Feature Cards (Home Screen) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.feature-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:active {
  transform: scale(0.98);
}

.feature-card-icon {
  font-size: 36px;
  margin-bottom: var(--space-sm);
  color: var(--primary);
}

.feature-card-title {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
}

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

.btn-primary:active {
  background-color: var(--primary-dark);
}

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

.btn-secondary:active {
  background-color: #007a8a;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

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

/* Form Inputs */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--incomplete);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text);
  background-color: var(--white);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--focus);
}

.form-input::placeholder {
  color: var(--incomplete);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--incomplete);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent-green);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.completed {
  background-color: var(--accent-green);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

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

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

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

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

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

/* Course Card */
.course-card {
  display: flex;
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.course-thumbnail {
  width: 100px;
  height: 80px;
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--incomplete);
}

.course-info {
  flex: 1;
  padding: var(--space-sm);
}

.course-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.course-progress-text {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

/* Event Card */
.event-card {
  display: flex;
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  min-width: 60px;
  margin-right: var(--space-md);
}

.event-date-day {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.event-date-month {
  font-size: 12px;
  text-transform: uppercase;
}

.event-details {
  flex: 1;
}

.event-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.event-meta {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-actions {
  display: flex;
  align-items: center;
}

/* Gig Card */
.gig-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.gig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.gig-title {
  font-size: 16px;
  font-weight: 600;
}

.gig-client {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-light);
}

.client-logo {
  width: 32px;
  height: 32px;
  background-color: #ddd;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Profile Section */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg) 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  background-color: var(--incomplete);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--white);
  margin-bottom: var(--space-md);
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

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

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

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

.profile-field-value {
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.edit-icon {
  color: var(--accent-teal);
  cursor: pointer;
  font-size: 18px;
}

/* Weather Widget */
.weather-widget {
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  color: var(--white);
  margin-bottom: var(--space-md);
}

.weather-temp {
  font-size: 48px;
  font-weight: 700;
}

.weather-condition {
  font-size: 16px;
  opacity: 0.9;
}

.weather-location {
  font-size: 14px;
  opacity: 0.8;
}

/* News Feed */
.news-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid #eee;
}

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

.news-thumbnail {
  width: 80px;
  height: 60px;
  background-color: #ddd;
  border-radius: var(--radius-sm);
}

.news-content {
  flex: 1;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.news-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* Share Screen */
.share-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.share-button {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.share-icon {
  font-size: 24px;
}

.share-icon.facebook { color: #1877F2; }
.share-icon.twitter { color: #1DA1F2; }
.share-icon.whatsapp { color: #25D366; }

.qr-code {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.qr-placeholder {
  width: 150px;
  height: 150px;
  background-color: #eee;
  border: 2px dashed var(--incomplete);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.referral-tracker {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.referral-progress {
  margin-top: var(--space-sm);
}

/* Calendar */
.calendar {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  text-align: center;
}

.calendar-day {
  font-size: 12px;
  color: var(--text-light);
  padding: var(--space-xs);
}

.calendar-date {
  font-size: 14px;
  padding: var(--space-sm);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.calendar-date:hover {
  background-color: #f0f0f0;
}

.calendar-date.selected {
  background-color: var(--primary);
  color: var(--white);
}

.calendar-date.unavailable {
  color: var(--incomplete);
  cursor: not-allowed;
}

/* Time Slots */
.time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.time-slot {
  padding: var(--space-md);
  background-color: var(--white);
  border: 1px solid var(--incomplete);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  font-size: 14px;
}

.time-slot:hover {
  border-color: var(--primary);
}

.time-slot.selected {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.time-slot.unavailable {
  background-color: #f5f5f5;
  color: var(--incomplete);
  cursor: not-allowed;
}

/* Bottom Nav Internal (Profile) */
.profile-tabs {
  display: flex;
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.profile-tab {
  flex: 1;
  padding: var(--space-md);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--inactive);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Carousel */
.carousel {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scroll-snap-type: x mandatory;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  min-width: 200px;
  scroll-snap-align: start;
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

/* Carousel scroll nudge animation */
@keyframes carousel-nudge {
  0%, 100% { transform: translateX(0); }
  25%, 75% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
}

.carousel-nudge {
  animation: carousel-nudge 1.5s ease-in-out;
}

/* Sign Up Screen */
.signup-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 56px - 60px);
  padding: var(--space-lg);
}

.signup-form {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.signup-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 14px;
}

.signup-footer a {
  color: var(--incomplete);
}

/* Map Placeholder */
.map-placeholder {
  width: 100%;
  height: 200px;
  background-color: #e0e0e0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--text-light);
  font-size: 14px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* Welcome Section */
.welcome-section {
  background: var(--gradient-primary);
  padding: var(--space-lg);
  margin: calc(-1 * var(--space-md));
  margin-bottom: var(--space-lg);
  color: var(--white);
}

.welcome-text {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.welcome-subtext {
  font-size: 14px;
  opacity: 0.9;
}

/* Section Title */
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text);
}

/* Icon placeholder */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* Divider */
.divider {
  height: 1px;
  background-color: #eee;
  margin: var(--space-md) 0;
}

/* Stat Card */
.stat-card {
  min-width: 100px;
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* News Page */
.news-header {
  background: var(--gradient-primary);
  padding: var(--space-lg);
  margin: calc(-1 * var(--space-md));
  margin-bottom: var(--space-lg);
  color: var(--white);
}

.news-header-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.news-header-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* Full Screen App Mode */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Safe area padding for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  
  .header {
    padding-top: max(var(--space-md), env(safe-area-inset-top));
  }
  
  .bottom-nav {
    padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
  }
}

/* Hide scrollbar but keep functionality */
::-webkit-scrollbar {
  display: none;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dialog Styles */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

dialog {
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

dialog h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

dialog .form-input {
  margin-bottom: var(--space-md);
}

dialog .btn {
  margin-top: var(--space-sm);
}
