/* ==========================================================================
   STYLE 08 — SMM PANEL ORDER PAGE DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- LIGHT MODE VARIABLES (DEFAULT) --- */
:root {
  --bg-primary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(216, 180, 254, 0.4);
  --border-subtle: rgba(226, 232, 240, 0.8);
  
  /* Accents & Gradients */
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --gradient-primary: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #fef4ff 100%);
  --shadow-card: 0 10px 25px -5px rgba(168, 85, 247, 0.08);
  --glow-effect: none;

  /* Status Badge Colors */
  --status-pending-bg: rgba(245, 158, 11, 0.12);
  --status-pending-text: #b45309;
  --status-pending-dot: #f59e0b;

  --status-processing-bg: rgba(168, 85, 247, 0.12);
  --status-processing-text: #7e22ce;
  --status-processing-dot: #a855f7;

  --status-completed-bg: rgba(34, 197, 94, 0.12);
  --status-completed-text: #15803d;
  --status-completed-dot: #22c55e;
}

/* --- DARK MODE OVERRIDES (AUTOMATIC DETECTION) --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0b071e;
    --bg-card: rgba(23, 15, 48, 0.75);
    --bg-card-hover: rgba(31, 20, 64, 0.85);
    --bg-glass: rgba(18, 11, 38, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(168, 85, 247, 0.3);
    --border-subtle: rgba(168, 85, 247, 0.15);

    --gradient-card: linear-gradient(145deg, rgba(29, 18, 62, 0.8), rgba(18, 11, 38, 0.9));
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --glow-effect: 0 0 20px rgba(168, 85, 247, 0.22);

    /* Status Badge Colors (Dark) */
    --status-pending-bg: rgba(245, 158, 11, 0.22);
    --status-pending-text: #fbbf24;

    --status-processing-bg: rgba(168, 85, 247, 0.25);
    --status-processing-text: #c084fc;

    --status-completed-bg: rgba(34, 197, 94, 0.22);
    --status-completed-text: #4ade80;
  }
}

/* Base Body Styles */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Layout Container */
.orders-page-wrapper {
  flex: 1 0 auto;
  max-width: 896px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
  box-sizing: border-box;
}

/* Header Navbar */
.orders-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
  max-width: 896px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.btn-back-store {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.btn-back-store:hover {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* Style 08 Banner Hero */
.style08-banner {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card), var(--glow-effect);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.banner-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(168, 85, 247, 0.35);
}

.banner-icon-wrapper svg {
  width: 26px;
  height: 26px;
}

.banner-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.banner-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
}

/* Search Bar & Tabs Controls */
.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Filter Pills */
.filter-tabs-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-tabs-container::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover, .tab-btn.active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* Dynamic Orders Cards Container */
.orders-list-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Style 08 Order Card */
.order-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card), var(--glow-effect);
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.order-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.6);
}

/* Card Header */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-subtle);
  gap: 0.75rem;
}

.order-id-wrapper {
  display: flex;
  flex-direction: column;
}

.order-id-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.order-id-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
}

.status-pill-Pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
}
.status-pill-Pending .status-pill-dot {
  background-color: var(--status-pending-dot);
}

.status-pill-Processing {
  background-color: var(--status-processing-bg);
  color: var(--status-processing-text);
}
.status-pill-Processing .status-pill-dot {
  background-color: var(--status-processing-dot);
}

.status-pill-Completed {
  background-color: var(--status-completed-bg);
  color: var(--status-completed-text);
}
.status-pill-Completed .status-pill-dot {
  background-color: var(--status-completed-dot);
}

/* Card Body Details */
.card-body-content {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.detail-block-full {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  display: block;
}

.service-title-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

/* Grid for Quantity & Target Link */
.card-details-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.85rem;
  background: rgba(168, 85, 247, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem;
  border-radius: 12px;
}

.quantity-value-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-purple);
}

/* TARGET LINK WRAPPING — NO TRUNCATION */
.target-link-wrapper {
  width: 100%;
}

.target-link-anchor {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-pink);
  text-decoration: none;
  display: block;
  
  /* Strict URL wrapping requirements */
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.target-link-anchor:hover {
  text-decoration: underline;
}

/* Card Footer */
.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.price-tag-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

/* No Orders Empty State */
.no-orders-card {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.no-orders-card.hidden {
  display: none !important;
}

.no-orders-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.no-orders-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.no-orders-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.5;
}

.btn-browse-services {
  display: inline-block;
  background: var(--gradient-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.3);
  transition: opacity 0.2s ease;
}

.btn-browse-services:hover {
  opacity: 0.92;
}

/* Footer Page */
.page-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-glass);
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Mobile Responsiveness Rules */
@media (max-width: 576px) {
  .orders-page-wrapper {
    padding: 1rem 0.75rem 2.5rem 0.75rem;
  }

  .style08-banner {
    padding: 1rem;
    gap: 0.85rem;
  }

  .banner-icon-wrapper {
    width: 44px;
    height: 44px;
  }

  .banner-title {
    font-size: 1.15rem;
  }

  .card-details-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}
