/* TailorsBook v3 - Modern Mobile-First Stylesheet */
:root {
  --primary-color: #e53935;
  --primary-dark: #c62828;
  --primary-light: #ff6f60;
  --gents-blue: #0288d1;
  --gents-light: #e1f5fe;
  --ladies-green: #2e7d32;
  --ladies-light: #e8f5e9;
  --accent-gold: #f57f17;
  --text-main: #212529;
  --text-muted: #6c757d;
  --bg-app: #f4f6f9;
  --card-bg: #ffffff;
  --border-color: #e9ecef;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Gujarati", "Noto Sans Devanagari", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  padding-bottom: 70px; /* Space for bottom nav on mobile */
  -webkit-font-smoothing: antialiased;
}

/* Mobile Container constraint for desktop while feeling native on phone */
.mobile-app-container {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #ffffff;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header Styles - Matching Hinglaj Tailor Red Bar */
.tb-navbar {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tb-nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.tb-nav-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tb-nav-btn {
  color: #ffffff;
  font-size: 1.35rem;
  background: transparent;
  border: none;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.tb-nav-btn:hover, .tb-nav-btn:focus {
  color: #ffebee;
}

/* App Main Content Area */
.app-content {
  flex: 1 0 auto;
  padding: 14px;
}

/* Buttons with Screenshot Style */
.btn-tb-search {
  background-color: #e53935;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-tb-search:hover, .btn-tb-search:focus {
  background-color: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-tb-contact {
  background-color: #e53935;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-tb-contact:hover, .btn-tb-contact:focus {
  background-color: var(--primary-dark);
  color: #ffffff;
}

/* Slider / Ad Card */
.ad-banner-card {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px 14px;
  margin: 14px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ad-banner-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 6px;
}

.ad-banner-phone {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffff00;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
}

.ad-free-badge {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Category Grid Cards (Gents & Ladies) */
.category-card {
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
}

.category-card.gents-card {
  background: linear-gradient(135deg, #29b6f6, #0288d1);
}

.category-card.ladies-card {
  background: linear-gradient(135deg, #43a047, #2e7d32);
}

.category-card .cat-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.category-card .cat-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.category-card .cat-icon {
  font-size: 3.5rem;
  line-height: 1;
}

/* Outfit Selection Cards (Grid View) */
.outfit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.outfit-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.outfit-card:hover, .outfit-card:focus {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--primary-dark);
}

.outfit-card.featured-red {
  background: linear-gradient(135deg, #e53935, #d32f2f);
  color: #ffffff;
  border: none;
}

.outfit-card.featured-red:hover {
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.outfit-card .outfit-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.outfit-card.featured-red .outfit-icon {
  color: #ffffff;
}

.outfit-card .outfit-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.2;
}

.outfit-card .outfit-sub {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Modern Form Sections & Collapsible Boxes */
.tb-form-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tb-card-header {
  padding: 12px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tb-card-header.header-primary {
  border-top: 3px solid #1976d2;
  color: #1565c0;
}

.tb-card-header.header-danger {
  border-top: 3px solid var(--primary-color);
  color: var(--primary-dark);
  cursor: pointer;
}

.tb-card-body {
  padding: 16px 14px;
}

.tb-form-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: #37474f;
  margin-bottom: 4px;
  display: block;
}

.tb-form-label .sub-lang {
  color: #757575;
  font-weight: normal;
  font-size: 0.88rem;
  margin-left: 4px;
}

.tb-input {
  border-radius: var(--radius-sm);
  border: 1.5px solid #cfd8dc;
  padding: 9px 12px;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s;
  background-color: #ffffff;
}

.tb-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
  outline: none;
}

/* FIX: Input Group Integration */
.input-group > .tb-input,
.input-group > .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group > .input-group-text {
  display: flex;
  align-items: center;
}

/* Beautiful Total & Payment Card Styling (Fix for User Issue) */
.total-payment-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1.5px solid #ffcdd2;
  padding: 16px;
  margin-bottom: 16px;
}

.total-input-wrapper {
  display: flex;
  align-items: stretch;
  border: 2px solid #e53935;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.1);
}

.total-currency-badge {
  background: #e53935;
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  user-select: none;
}

.total-number-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 1.6rem;
  font-weight: 800;
  color: #d32f2f;
  padding: 10px 14px;
  width: 100%;
  flex: 1;
}

.total-number-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Floating Save Action */
.btn-save-main {
  background-color: #0288d1;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  width: 100%;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.btn-save-main:hover {
  background-color: #0277bd;
  color: #ffffff;
}

/* Bottom Navigation Bar for Mobile */
.tb-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: 60px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1030;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #757575;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.bottom-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

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

/* Language Switcher Buttons */
.lang-btn-option {
  font-weight: 700;
  font-size: 0.85rem;
}

.lang-btn-option.active {
  background-color: #e53935 !important;
  color: #ffffff !important;
  border-color: #e53935 !important;
}

/* Footer Copyright */
.tb-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #757575;
  padding: 20px 14px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.tb-footer a {
  color: #0288d1;
  text-decoration: none;
  font-weight: 600;
}

/* Print Styling */
@media print {
  body {
    background: #ffffff !important;
    padding-bottom: 0 !important;
  }
  .tb-navbar, .tb-bottom-nav, .no-print, .btn, .offcanvas {
    display: none !important;
  }
  .mobile-app-container {
    max-width: 100% !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-clean {
    border: none !important;
    box-shadow: none !important;
  }
}


/* Network Status & Sync Indicators */
.tb-network-badge {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  max-width: 90%;
  pointer-events: none;
}

.network-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.network-pill.offline {
  background-color: #ff9800;
  color: #ffffff;
}

.network-pill.syncing {
  background-color: #1976d2;
  color: #ffffff;
}

.network-pill.online {
  background-color: #2e7d32;
  color: #ffffff;
}

.tb-sync-toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #212121;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  z-index: 1060;
  animation: slideUpFade 0.3s ease;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 15px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
