* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 769px) {
  body {
    margin-left: 280px;
  }
}

body.rtl {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  direction: rtl;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

@media (max-width: 768px) {
  .container {
    padding: 0;
    max-width: 100%;
    margin: 0;
  }
}

/* SIDEBAR NAVIGATION */
.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  width: 280px;
  height: calc(100vh - 60px);
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 999;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0);
    top: 60px;
  }
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  gap: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 4px solid transparent;
  font-size: 15px;
  font-weight: 500;
}

.sidebar-item:hover {
  background-color: #f5f5f5;
  border-left-color: #1e40af;
  color: #1e40af;
}

.sidebar-item.active {
  background-color: #e3f2fd;
  border-left-color: #1e40af;
  color: #1e40af;
}

.sidebar-item .icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sidebar-item .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item.logout-btn {
  color: #d32f2f;
}

.sidebar-item.logout-btn:hover {
  background-color: #ffebee;
  border-left-color: #d32f2f;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* NAVBAR */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100;
  direction: ltr;
  height: 60px;
  display: flex;
  align-items: center;
}

@media (min-width: 769px) {
  .navbar {
    margin-left: -280px;
  }
}

.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
}

.nav-brand {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

/* Mobile navbar - hamburger on left, text next to it, earth on right */
@media (max-width: 768px) {
  .nav-container {
    padding: 10px 8px;
    gap: 8px;
    direction: ltr;
    flex-direction: row;
  }

  .hamburger-menu {
    padding: 4px 6px;
    display: flex !important;
    flex-shrink: 0;
    order: 1;
  }

  .hamburger-menu span {
    width: 24px;
    height: 3px;
  }

  .nav-brand {
    font-size: 0.95rem;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: left;
    padding: 0 3px;
    order: 2;
    direction: ltr;
  }

  .nav-links {
    display: none;
  }

  .lang-switch {
    position: static;
    flex-shrink: 0;
    margin-left: auto;
    gap: 0;
    order: 3;
    direction: ltr;
  }

  .lang-toggle {
    padding: 4px;
    font-size: 1.2rem;
    margin: 0;
    display: flex !important;
  }
}

@media (min-width: 769px) {
  .hamburger-menu {
    display: none !important;
  }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 20px;
}

/* HAMBURGER MENU */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.hamburger-menu span {
  width: 26px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger-menu:hover span {
  background-color: #f0f0f0;
}

/* LANGUAGE SWITCH */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.lang-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.2s;
}

.lang-toggle:hover {
  transform: scale(1.15);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  min-width: 160px;
}

.lang-dropdown.active {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
  font-size: 14px;
}

.lang-option:first-child {
  border-radius: 8px 8px 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 8px 8px;
}

.lang-option:hover {
  background: #f5f5f5;
}

.lang-option.active {
  background: #e3f2fd;
  color: #1e40af;
  font-weight: 600;
}

.lang-flag-img {
  width: 20px;
  height: auto;
}

/* RESPONSIVE - MOBILE */
@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
  }

  .nav-links {
    display: none !important;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .sidebar {
    display: block;
  }

  .sidebar-overlay {
    display: none;
  }
}

/* RESPONSIVE - DESKTOP */
@media (min-width: 769px) {
  .hamburger-menu {
    display: none !important;
  }

  .sidebar {
    display: block !important;
    transform: translateX(0) !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .nav-links {
    display: flex !important;
  }
}

/* VISIBILITY CLASSES */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }
}

/* ORDERS TABLE */
.orders-table {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.orders-table table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table thead {
  background-color: #1e40af;
  color: white;
}

.orders-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.orders-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

.orders-table tbody tr:hover {
  background-color: #f9fafb;
}

.orders-table code {
  background: #f0f4ff !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  font-family: monospace !important;
  font-size: 12px !important;
  color: #1e40af !important;
}

/* ORDERS CARDS - MOBILE */
.orders-cards {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.order-card-mobile {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 80px 1fr 70px;
  gap: 12px;
  align-items: start;
}

.order-image {
  width: 80px;
  height: 80px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.order-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  font-size: 2.5rem;
}

.order-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-details h3 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.order-details p {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.order-status {
  margin: 3px 0 !important;
}

.order-price {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1e40af !important;
  margin: 5px 0 0 0 !important;
}

.pending-price {
  color: #999;
  font-size: 12px;
}

.order-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.btn-view {
  background: #1e40af;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background 0.3s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn-view:hover {
  background: #1e3a8a;
}

/* STATUS BADGES */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-badge.status-processing {
  background-color: #cce5ff;
  color: #004085;
}

.status-badge.status-shipped {
  background-color: #d1ecf1;
  color: #0c5460;
}

.status-badge.status-delivered {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.status-cancelled {
  background-color: #f8d7da;
  color: #721c24;
}

/* DASHBOARD */
.dashboard {
  padding: 20px;
  background-color: #f5f7fa;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  gap: 15px;
  flex-wrap: wrap;
}

.dashboard-header h1 {
  font-size: 28px;
  color: #1e40af;
  margin: 0;
}

.empty-state {
  background: white;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  color: #666;
  margin-bottom: 20px;
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.3s;
}

.btn:hover {
  background: #1e3a8a;
}

.btn-primary {
  background: #1e40af;
}

.btn-primary:hover {
  background: #1e3a8a;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.text-muted {
  color: #999;
}

@media (max-width: 768px) {
  .dashboard {
    padding: 10px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
  }

  .dashboard-header h1 {
    font-size: 22px;
  }

  .dashboard-header .btn {
    width: 100%;
    text-align: center;
  }

  .order-card-mobile {
    padding: 12px;
    gap: 10px;
    grid-template-columns: 70px 1fr 60px;
  }

  .order-image {
    width: 70px;
    height: 70px;
  }

  .order-details h3 {
    font-size: 14px;
  }

  .order-details p {
    font-size: 11px;
  }

  .btn-view {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* FOOTER */
.footer {
  background: #f5f7fa;
  border-top: 1px solid #e0e0e0;
  padding: 20px;
  text-align: center;
  margin-top: auto;
}

.social-links {
  margin-top: 10px;
}

.social-link {
  display: inline-block;
  padding: 8px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #1e40af;
  font-weight: 600;
  transition: all 0.3s;
}

.social-link:hover {
  background: #1e40af;
  color: white;
}

.telegram-icon {
  margin-right: 5px;
}

/* ORDER DETAIL PAGE */
.detail-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

@media (max-width: 768px) {
  .detail-container {
    padding: 10px;
  }
}

.detail-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 768px) {
  .detail-card {
    padding: 15px;
    gap: 15px;
  }
}

.detail-image {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .detail-image {
    max-width: 100%;
    height: 200px;
  }
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.detail-header h2 {
  font-size: 24px;
  color: #333;
  margin: 0;
}

@media (max-width: 768px) {
  .detail-header h2 {
    font-size: 18px;
  }
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e40af;
  margin: 0;
}

@media (max-width: 768px) {
  .detail-section h3 {
    font-size: 14px;
  }
}

.detail-row {
  display: flex;
  gap: 15px;
  padding: 8px 0;
}

@media (max-width: 768px) {
  .detail-row {
    flex-direction: column;
    gap: 5px;
  }
}

.detail-row .label {
  font-weight: 600;
  color: #666;
  min-width: 120px;
}

@media (max-width: 768px) {
  .detail-row .label {
    min-width: auto;
  }
}

.detail-row .value {
  color: #333;
  word-break: break-word;
}

.price-section {
  background: #f0f7ff;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #1e40af;
}

@media (max-width: 768px) {
  .price-section {
    padding: 15px;
  }
}

.price-display {
  font-size: 32px;
  font-weight: 700;
  color: #1e40af;
  margin: 10px 0;
}

@media (max-width: 768px) {
  .price-display {
    font-size: 24px;
  }
}

.admin-notes {
  margin-top: 15px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #ff9800;
}

.admin-notes strong {
  color: #ff9800;
}

.admin-notes p {
  margin: 5px 0 0 0;
  color: #666;
}

.response-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .response-buttons {
    flex-direction: column;
  }

  .response-buttons .btn {
    width: 100%;
  }
}

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

.form-group label {
  font-weight: 600;
  color: #333;
}

.form-group textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .btn {
    width: 100%;
  }
}

.btn-outline {
  background: white;
  color: #1e40af;
  border: 2px solid #1e40af;
}

.btn-outline:hover {
  background: #1e40af;
  color: white;
}

.btn-success {
  background: #28a745;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
}

/* CATEGORIES PAGE */
.categories-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
  .categories-container {
    padding: 10px;
  }
}

.categories-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .categories-card {
    padding: 20px;
  }
}

.categories-card h1 {
  font-size: 32px;
  color: #1e40af;
  margin: 0 0 10px 0;
  text-align: center;
}

@media (max-width: 768px) {
  .categories-card h1 {
    font-size: 24px;
  }
}

.categories-subtitle {
  text-align: center;
  color: #666;
  margin: 0 0 30px 0;
  font-size: 16px;
}

@media (max-width: 768px) {
  .categories-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
  }
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 25px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
  border: 2px solid #1e40af;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-item:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1a36a3 100%);
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

@media (max-width: 768px) {
  .category-item {
    padding: 20px;
    gap: 10px;
  }
}

.category-icon {
  font-size: 48px;
}

@media (max-width: 768px) {
  .category-icon {
    font-size: 36px;
  }
}

.category-name {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 768px) {
  .category-name {
    font-size: 16px;
  }
}

.categories-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .categories-actions {
    flex-direction: column;
  }

  .categories-actions .btn {
    width: 100%;
  }
}

/* NEW ORDER FORM PAGE */
.form-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 200px);
  background-color: #f5f7fa;
}

@media (max-width: 768px) {
  .form-container {
    padding: 10px;
  }
}

.form-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 30px;
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .form-card {
    padding: 20px;
  }
}

.form-card h2 {
  font-size: 28px;
  color: #1e40af;
  margin: 0 0 25px 0;
  text-align: center;
}

@media (max-width: 768px) {
  .form-card h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }
}

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

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.form-group input[type="file"] {
  padding: 10px;
  border: 2px dashed #1e40af;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
}

.form-group small {
  color: #666;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
  }
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.btn-primary {
  background: #1e40af;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover:not(:disabled) {
  background: #1e3a8a;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-outline {
  background: white;
  color: #1e40af;
  border: 2px solid #1e40af;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: #1e40af;
  color: white;
}
