/* RTL Support */
* {
  direction: rtl;
  text-align: right;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation */
.nav-link {
  color: rgb(55, 65, 81);
  font-weight: 500;
  transition: all 0.3s;
}

.nav-link:hover {
  color: #0f4c81;
}

/* ========================================
   BUTTON SYSTEM - Unified & Polished
   ======================================== */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #0f4c81 0%, #1e7bb8 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e7bb8 0%, #2a8bc9 100%);
  box-shadow: 0 6px 16px rgba(15, 76, 129, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
  box-shadow: 0 6px 16px rgba(75, 85, 99, 0.3);
}

/* Success Button */
.btn-success {
  background-color: #059669;
  color: white;
}

.btn-success:hover {
  background-color: #047857;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3);
}

/* Danger Button */
.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

/* Warning Button */
.btn-warning {
  background-color: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background-color: #d97706;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

/* Outline Buttons */
.btn-outline-primary {
  background-color: transparent;
  color: #0f4c81;
  border: 2px solid #0f4c81;
  box-shadow: none;
}

.btn-outline-primary:hover {
  background-color: #0f4c81;
  color: white;
}

.btn-outline-secondary {
  background-color: transparent;
  color: #6b7280;
  border: 2px solid #6b7280;
  box-shadow: none;
}

.btn-outline-secondary:hover {
  background-color: #6b7280;
  color: white;
}

/* Button Sizes */
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-large:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Icon Buttons */
.btn-icon {
  padding: 0.75rem;
  aspect-ratio: 1;
  border-radius: 0.5rem;
}

.btn-icon-small {
  padding: 0.5rem;
  aspect-ratio: 1;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

/* Full Width Button */
.btn-block {
  display: flex;
  width: 100%;
}

/* Service Cards */
.service-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
}

.service-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #0f4c81;
}

/* Gallery Items */
.gallery-item {
  cursor: pointer;
  transition: opacity 0.3s;
}

.gallery-item:hover {
  opacity: 0.8;
}

/* Article Cards */
.article-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
}

.article-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Hero Gradient */
.hero-gradient {
  background: linear-gradient(135deg, #0f4c81 0%, #1e7bb8 100%);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Steps */
.step-card {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.step-number {
  width: 4rem;
  height: 4rem;
  background-color: white;
  color: #0f4c81;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem auto;
}

/* Feature Box */
.feature-box {
  text-align: center;
  padding: 1.5rem;
  background-color: rgb(249, 250, 251);
  border-radius: 0.5rem;
  transition: all 0.3s;
}

.feature-box:hover {
  background-color: rgb(243, 244, 246);
}

/* Social Icons */
.social-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgb(55, 65, 81);
  color: white;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.social-icon:hover {
  background-color: #0f4c81;
}

/* Floating Buttons */
.floating-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}

.floating-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.floating-btn:active {
  transform: scale(1.05);
}

/* Accessibility */
.accessibility-btn {
  padding: 0.5rem 0.75rem;
  background-color: rgb(55, 65, 81);
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.accessibility-btn:hover {
  background-color: rgb(75, 85, 99);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.accessibility-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="file"],
select,
textarea {
  direction: rtl;
  text-align: right;
}

/* Accessibility Features */
body.large-text {
  font-size: 120%;
}

body.larger-text {
  font-size: 140%;
}

body.grayscale {
  filter: grayscale(100%);
}

body.high-contrast {
  filter: contrast(150%);
}

body.invert-colors {
  filter: invert(100%);
}

body.light-background {
  background: #ffffff !important;
}

body.light-background * {
  background: #ffffff !important;
  color: #000000 !important;
}

body.highlight-links a {
  text-decoration: underline !important;
  font-weight: bold !important;
}

body.readable-font {
  font-family: Arial, sans-serif !important;
}

/* Loading Spinner */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: #0f4c81;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.readable-font * {
  font-family: Arial, sans-serif !important;
}

/* Mobile Menu */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.show {
  max-height: 500px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Print Styles */
@media print {
  header, footer, .floating-btn, #accessibility-toolbar, #accessibility-toggle {
    display: none !important;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Focus Visible */
*:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* Schema.org LocalBusiness Structured Data */
.schema-hide {
  display: none;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
  .nav-link {
    display: block;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    text-align: center;
  }
  
  .service-card {
    margin-bottom: 1rem;
  }
}

/* Admin Panel Specific Styles */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 250px;
  background-color: rgb(31, 41, 55);
  color: white;
  padding: 1rem;
}

.admin-content {
  flex: 1;
  padding: 2rem;
  background-color: rgb(249, 250, 251);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
  display: grid;
  padding: 1rem;
  background-color: rgb(249, 250, 251);
  font-weight: 600;
  border-bottom: 2px solid rgb(229, 231, 235);
}

.table-row {
  display: grid;
  padding: 1rem;
  border-bottom: 1px solid rgb(229, 231, 235);
  transition: background-color 0.2s;
}

.table-row:hover {
  background-color: rgb(249, 250, 251);
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  display: inline-block;
}

.status-badge.status-new {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-badge.status-processing {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.status-ready {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Form Validation */
input.error,
select.error,
textarea.error {
  border-color: #ef4444 !important;
  border-width: 2px;
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #0f4c81;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-right: 4px solid #10b981;
}

.toast.error {
  border-right: 4px solid #ef4444;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Utility Classes */
.text-primary {
  color: #0f4c81;
}

.bg-primary {
  background-color: #0f4c81;
}

.text-secondary {
  color: #1e7bb8;
}

.bg-secondary {
  background-color: #1e7bb8;
}

/* ========================================
   ADMIN BUTTON UTILITIES
   ======================================== */

/* Edit Button */
.btn-edit {
  background-color: #0f4c81;
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-edit:hover {
  background-color: #1e7bb8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(15, 76, 129, 0.2);
}

/* Delete Button */
.btn-delete {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-delete:hover {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

/* Login Button */
.btn-login {
  background: linear-gradient(135deg, #0f4c81 0%, #1e7bb8 100%);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 8px rgba(15, 76, 129, 0.2);
}

.btn-login:hover {
  background: linear-gradient(135deg, #1e7bb8 0%, #2a8bc9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 76, 129, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

/* Action Button (for small actions) */
.action-btn {
  background-color: #6b7280;
  color: white;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.action-btn:hover {
  background-color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ========================================
   BUTTON LOADING STATE
   ======================================== */

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */
/* Button cancel */
.btn-cancel {
  background: #6b7280;
  color: white;
}

.btn-cancel:hover {
  background: #4b5563;
}

/* Flex utilities */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grid utilities */
.grid-full-width {
  grid-column: 1 / -1;
}

/* State utilities */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

/* Admin header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Modal wide */
.modal-wide {
  max-width: 800px;
}

/* Product image */
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stat icon backgrounds */
.stat-icon-blue {
  background: #dbeafe;
}

.stat-icon-yellow {
  background: #fef3c7;
}

.stat-icon-red {
  background: #fef2f2;
}

.stat-icon-green {
  background: #d1fae5;
}

/* Icon colors */
.icon-blue {
  color: #1e40af;
}

.icon-yellow {
  color: #92400e;
}

.icon-red {
  color: #dc2626;
}

.icon-green {
  color: #065f46;
}

.icon-primary {
  color: #0f4c81;
}

.icon-accent {
  color: #f59e0b;
}

/* Filter select styling */
.filter-select-inline {
  max-width: 200px;
}

/* Form padding */
.form-padding {
  padding-left: 45px;
}

/* Layout utilities */
.mt-20 {
  margin-top: 20px;
}

.flex-gap-6 {
  display: flex;
  gap: 6px;
}

.text-20 {
  font-size: 20px;
}

.hr-20 {
  margin: 20px 0;
}
