/**
 * CLIENT AREA - INSTAGRAM INSPIRED
 * Ultra-minimalist, clean, and intuitive
 * Mobile-first with Instagram aesthetics
 */

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Instagram Colors */
  --ig-primary: #0095f6;
  --ig-gradient-start: #f09433;
  --ig-gradient-mid: #e6683c;
  --ig-gradient-end: #bc1888;
  --ig-gradient-purple: #5851db;
  --ig-gradient-blue: #405de6;

  /* Base Colors */
  --white: #ffffff;
  --black: #000000;
  --grey-0: #fafafa;
  --grey-1: #f5f5f5;
  --grey-2: #efefef;
  --grey-3: #dbdbdb;
  --grey-4: #c7c7c7;
  --grey-5: #a8a8a8;
  --grey-6: #8e8e8e;
  --grey-7: #737373;
  --grey-8: #262626;

  /* Semantic */
  --success: #00c853;
  --error: #ed4956;
  --warning: #ffc107;
  --info: #0095f6;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 28px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;

  /* Layout */
  --header-height: 54px;
  --bottom-nav-height: 50px;
  --max-width: 935px;

  /* Effects */
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-full: 50%;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,.15);
  --border: 1px solid var(--grey-3);
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--grey-8);
  background: var(--grey-0);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--grey-3);
  border-radius: 3px;
}

/* ============================================
   LAYOUT
   ============================================ */
.ig-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ig-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  border-bottom: var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
}

.ig-header-logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: linear-gradient(45deg, var(--ig-gradient-purple), var(--ig-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.ig-header-actions {
  display: flex;
  gap: var(--spacing-lg);
}

.ig-icon-btn {
  background: none;
  border: none;
  padding: var(--spacing-sm);
  cursor: pointer;
  color: var(--grey-8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  transition: background 0.2s;
}

.ig-icon-btn:active {
  background: var(--grey-1);
  transform: scale(0.95);
}

.ig-main {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--bottom-nav-height) + var(--spacing-lg));
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

.ig-container {
  padding: 0 var(--spacing-lg);
}

/* ============================================
   BOTTOM NAVIGATION (Instagram Style)
   ============================================ */
.ig-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--white);
  border-top: var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0;
}

.ig-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--grey-8);
  text-decoration: none;
  position: relative;
  transition: transform 0.1s;
}

.ig-nav-item:active {
  transform: scale(0.9);
}

.ig-nav-item.active {
  color: var(--black);
}

.ig-nav-item svg {
  width: 24px;
  height: 24px;
}

.ig-nav-item.active svg {
  fill: var(--black);
}

.ig-nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 18px);
  min-width: 18px;
  height: 18px;
  background: var(--error);
  color: var(--white);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

/* ============================================
   CARDS
   ============================================ */
.ig-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}

.ig-card-header {
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border);
}

.ig-card-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--grey-8);
}

.ig-card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--grey-6);
  margin-top: 2px;
}

.ig-card-body {
  padding: var(--spacing-lg);
}

/* ============================================
   BUTTONS
   ============================================ */
.ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.ig-btn:active {
  transform: scale(0.98);
}

.ig-btn-primary {
  background: var(--ig-primary);
  color: var(--white);
}

.ig-btn-primary:active {
  background: #0084d9;
}

.ig-btn-gradient {
  background: linear-gradient(45deg, var(--ig-gradient-mid), var(--ig-gradient-purple));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(225,48,108,0.25);
}

.ig-btn-outline {
  background: transparent;
  border: 1px solid var(--grey-3);
  color: var(--grey-8);
}

.ig-btn-outline:active {
  background: var(--grey-0);
}

.ig-btn-text {
  background: transparent;
  color: var(--ig-primary);
  padding: var(--spacing-sm);
}

.ig-btn-full {
  width: 100%;
}

.ig-btn-sm {
  padding: 6px var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* ============================================
   INPUTS
   ============================================ */
.ig-input-group {
  margin-bottom: var(--spacing-lg);
}

.ig-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--grey-7);
  margin-bottom: var(--spacing-sm);
}

.ig-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--grey-8);
  background: var(--grey-0);
  border: 1px solid var(--grey-3);
  border-radius: var(--border-radius-sm);
  outline: none;
  transition: all 0.2s;
}

.ig-input:focus {
  background: var(--white);
  border-color: var(--grey-4);
}

.ig-input::placeholder {
  color: var(--grey-5);
}

/* ============================================
   STATS BAR
   ============================================ */
.ig-stats-bar {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ig-stats-bar::-webkit-scrollbar {
  display: none;
}

.ig-stat-card {
  flex-shrink: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  min-width: 120px;
  text-align: center;
}

.ig-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--grey-8);
  margin-bottom: 4px;
}

.ig-stat-label {
  font-size: var(--font-size-xs);
  color: var(--grey-6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ============================================
   FILTERS (Stories-like)
   ============================================ */
.ig-filters {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: var(--spacing-md);
}

.ig-filters::-webkit-scrollbar {
  display: none;
}

.ig-filter-chip {
  flex-shrink: 0;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--grey-0);
  border: 1px solid var(--grey-3);
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--grey-7);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.ig-filter-chip:active {
  transform: scale(0.95);
}

.ig-filter-chip.active {
  background: var(--grey-8);
  color: var(--white);
  border-color: var(--grey-8);
}

.ig-filter-badge {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  margin-left: 6px;
  font-size: 11px;
  padding: 0 6px;
}

.ig-filter-chip.active .ig-filter-badge {
  background: rgba(255,255,255,0.2);
}

/* ============================================
   ORDER CARD
   ============================================ */
.ig-order-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  transition: transform 0.2s;
}

.ig-order-card:active {
  transform: scale(0.99);
}

.ig-order-header {
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grey-0);
}

.ig-order-id {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--grey-8);
}

.ig-order-date {
  font-size: var(--font-size-xs);
  color: var(--grey-6);
}

.ig-order-body {
  padding: var(--spacing-lg);
}

.ig-order-service {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--grey-8);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.ig-order-details {
  display: grid;
  gap: var(--spacing-md);
}

.ig-detail-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--grey-0);
  border-radius: var(--border-radius-sm);
}

.ig-detail-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-6);
  flex-shrink: 0;
}

.ig-detail-content {
  flex: 1;
  min-width: 0;
}

.ig-detail-label {
  font-size: var(--font-size-xs);
  color: var(--grey-6);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ig-detail-value {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--grey-8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-detail-value a {
  color: var(--ig-primary);
  text-decoration: none;
}

/* ============================================
   PROGRESS
   ============================================ */
.ig-progress-section {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-lg);
  background: var(--grey-0);
  border-radius: var(--border-radius);
}

.ig-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.ig-progress-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--grey-7);
}

.ig-progress-percent {
  font-size: var(--font-size-lg);
  font-weight: 700;
  background: linear-gradient(45deg, var(--ig-gradient-mid), var(--ig-gradient-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ig-progress-bar {
  height: 4px;
  background: var(--grey-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.ig-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ig-gradient-mid), var(--ig-gradient-purple));
  border-radius: 2px;
  transition: width 0.6s ease-out;
}

/* Timeline */
.ig-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding-top: var(--spacing-md);
}

.ig-timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--grey-2);
}

.ig-timeline-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.ig-timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--grey-3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  transition: all 0.3s;
}

.ig-timeline-step.active .ig-timeline-dot {
  border-color: var(--ig-primary);
  background: var(--ig-primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(0,149,246,0.1);
}

.ig-timeline-step.completed .ig-timeline-dot {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
}

.ig-timeline-label {
  font-size: var(--font-size-xs);
  color: var(--grey-6);
  text-align: center;
  font-weight: 600;
}

.ig-timeline-step.active .ig-timeline-label,
.ig-timeline-step.completed .ig-timeline-label {
  color: var(--grey-8);
}

/* ============================================
   STATUS BADGE
   ============================================ */
.ig-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--spacing-md);
  background: var(--grey-1);
  border-radius: 20px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ig-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ig-status.completed {
  background: rgba(0,200,83,0.1);
  color: var(--success);
}

.ig-status.completed .ig-status-dot {
  background: var(--success);
}

.ig-status.processing {
  background: rgba(0,149,246,0.1);
  color: var(--ig-primary);
}

.ig-status.processing .ig-status-dot {
  background: var(--ig-primary);
}

.ig-status.pending {
  background: rgba(255,193,7,0.1);
  color: var(--warning);
}

.ig-status.pending .ig-status-dot {
  background: var(--warning);
}

.ig-status.error {
  background: rgba(237,73,86,0.1);
  color: var(--error);
}

.ig-status.error .ig-status-dot {
  background: var(--error);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.ig-empty {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-xl);
}

.ig-empty-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--spacing-xl);
  background: var(--grey-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-4);
}

.ig-empty-icon svg {
  width: 48px;
  height: 48px;
}

.ig-empty-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--grey-8);
  margin-bottom: var(--spacing-sm);
}

.ig-empty-text {
  font-size: var(--font-size-base);
  color: var(--grey-6);
  margin-bottom: var(--spacing-xl);
  line-height: 1.5;
}

/* ============================================
   VERIFICATION CODE
   ============================================ */
.ig-code-inputs {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin: var(--spacing-xl) 0;
}

.ig-code-input {
  width: 56px;
  height: 64px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  background: var(--grey-0);
  border: 2px solid var(--grey-3);
  border-radius: var(--border-radius-sm);
  outline: none;
  transition: all 0.2s;
  caret-color: var(--ig-primary);
}

.ig-code-input:focus {
  background: var(--white);
  border-color: var(--ig-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,149,246,0.15);
}

.ig-code-input.filled {
  border-color: var(--success);
  background: rgba(0,200,83,0.05);
  color: var(--success);
}

.ig-code-input.error {
  border-color: var(--error);
  background: rgba(237,73,86,0.05);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ============================================
   ALERT
   ============================================ */
.ig-alert {
  padding: var(--spacing-lg);
  background: var(--grey-0);
  border: var(--border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  display: flex;
  gap: var(--spacing-md);
}

.ig-alert-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-alert.info .ig-alert-icon {
  background: rgba(0,149,246,0.1);
  color: var(--ig-primary);
}

.ig-alert.success .ig-alert-icon {
  background: rgba(0,200,83,0.1);
  color: var(--success);
}

.ig-alert.error .ig-alert-icon {
  background: rgba(237,73,86,0.1);
  color: var(--error);
}

.ig-alert-content {
  flex: 1;
}

.ig-alert-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--grey-8);
  margin-bottom: 4px;
}

.ig-alert-text {
  font-size: var(--font-size-sm);
  color: var(--grey-7);
  line-height: 1.4;
}

/* ============================================
   UTILITIES
   ============================================ */
.ig-divider {
  height: 1px;
  background: var(--grey-2);
  margin: var(--spacing-lg) 0;
}

.ig-text-center {
  text-align: center;
}

.ig-text-muted {
  color: var(--grey-6);
}

.ig-mt-lg {
  margin-top: var(--spacing-lg);
}

.ig-mb-lg {
  margin-bottom: var(--spacing-lg);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ig-animate-slide-up {
  animation: slideUp 0.4s ease-out;
}

.ig-animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
  .ig-main {
    padding-bottom: var(--spacing-xl);
  }

  .ig-bottom-nav {
    display: none;
  }

  .ig-header {
    padding: 0 var(--spacing-xl);
  }

  .ig-order-details {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ig-code-input {
    width: 48px;
    height: 56px;
    font-size: 24px;
  }

  .ig-code-inputs {
    gap: var(--spacing-sm);
  }
}
