@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ==========================================================
   Assets/css/user-panel.css
   Modern, App-Like, Fully Responsive UI
   ========================================================== */

:root {
  /* Modern Blue Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #38bdf8;
  
  /* Backgrounds & Surfaces */
  --bg-page: #f8fafc; /* Soft modern gray/blue bg */
  --bg-card: #ffffff;
  
  /* Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  /* Borders & States */
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Premium Soft Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 15px 35px rgba(37, 99, 235, 0.1);
  --shadow-glow: 0 8px 16px rgba(37, 99, 235, 0.25);
  
  /* Radii */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
}

/* --- Base & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar for a premium feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- Layout Containers --- */
.panel-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar (Desktop) --- */
.panel-sidebar {
  width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 1px 0 15px rgba(0,0,0,0.02);
}

.sidebar-header {
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.user-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-border);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sidebar-user-info h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.sidebar-user-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 16px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu li {
  margin-bottom: 8px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(-4px); /* Subtle shift to the right in RTL */
}

.sidebar-menu li.active a {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.sidebar-menu a svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-menu li.active a svg {
  transform: scale(1.1);
}

/* --- Main Content Area --- */
.panel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-navbar {
  height: 76px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.panel-content {
  padding: 32px;
  flex: 1;
}

/* --- Cards & Widgets --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary-border);
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-info {
  text-align: right;
}

.stat-info span {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-info h3 {
  margin: 6px 0 0 0;
  font-size: 1.6rem;
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* --- Base Panel Box --- */
.panel-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 28px;
  transition: box-shadow 0.3s ease;
}

.panel-box:hover {
  box-shadow: var(--shadow-md);
}

.panel-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.panel-box-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Modern Tables --- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.panel-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  white-space: nowrap;
}

.panel-table th {
  background: var(--bg-page);
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.panel-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: background 0.2s ease;
}

.panel-table tr:hover td {
  background: var(--primary-light);
}

.panel-table tr:last-child td {
  border-bottom: none;
}

/* --- Badges --- */
.badge {
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.2px;
}

/* Premium Badge Colors */
.badge-pending    { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-processing { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.badge-shipped    { background: #faf5ff; color: #6d28d9; border: 1px solid #e9d5ff; }
.badge-delivered  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-cancelled  { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-credit     { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-debit      { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* --- Custom Buttons --- */
.btn-primary, .btn-outline, .btn-danger {
  font-family: inherit;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { 
  background: var(--primary-hover); 
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

/* --- Forms --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-right: 4px; /* RTL visual alignment */
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-page);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* ==========================================================
   Mobile Responsive - App UI Style
   ========================================================== */
@media (max-width: 900px) {
  
  .panel-container { 
    flex-direction: column; 
  }
  
  /* Make sidebar behave like a top sticky App Bar + Horizontal Tabs */
  .panel-sidebar { 
    width: 100%; 
    border-left: none; 
    border-bottom: 1px solid var(--border-color); 
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  }

  .sidebar-header {
    padding: 16px 20px;
    border-bottom: none; /* Flow seamlessly into the tabs */
  }
  
  .user-avatar-wrap {
    width: 46px;
    height: 46px;
  }

  /* Transform Menu into Swipeable Horizontal Tabs */
  .sidebar-menu { 
    display: flex; 
    flex-direction: row; /* Horizontal */
    flex-wrap: nowrap; 
    overflow-x: auto; 
    padding: 0 20px 16px 20px;
    margin: 0;
    gap: 12px;
    /* Hide scrollbar for clean UI */
    scrollbar-width: none; 
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
  }
  
  .sidebar-menu::-webkit-scrollbar {
    display: none; 
  }

  .sidebar-menu li { 
    flex: 0 0 auto; /* Prevent shrinking */
    scroll-snap-align: start;
  }

  .sidebar-menu a {
    padding: 10px 20px;
    border-radius: 30px; /* Pill shape for horizontal tabs */
    background: var(--bg-page);
    border: 1px solid transparent;
    white-space: nowrap;
    font-size: 0.9rem;
  }
  
  .sidebar-menu a:hover {
    transform: none; /* Disable shift effect on mobile */
  }

  .sidebar-menu li.active a {
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
  }

  /* Main content adjustments */
  .panel-main {
    min-width: 100%;
  }

  /* Optional: Hide desktop navbar on mobile if header covers everything */
  .panel-navbar { 
    padding: 0 20px;
    height: 64px;
    z-index: 98;
  }

  .panel-content { 
    padding: 20px; 
  }

  .stat-grid {
    grid-template-columns: 1fr; /* Stack cards on mobile */
  }
  
  .panel-box {
    padding: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr; /* Stack forms */
  }
}
