/* Persian RTL Styles for Aramgah Online Cemetery Platform */

/* Import Nastaliq Font for Gravestone */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

:root {
  --primary-color: #2E7D32; /* Green */
  --secondary-color: #FBC02D; /* Gold */
  --background-color: #F5F5F5; /* Light gray */
  --text-color: #212121; /* Dark gray */
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --primary-color: #4CAF50;
  --secondary-color: #FFC107;
  --background-color: #121212;
  --text-color: #FFFFFF;
  --card-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Base Styles */
html {
  font-size: 14px;
  font-family: 'Vazir', 'Tahoma', sans-serif;
  direction: rtl;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Vazir', 'Tahoma', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: var(--transition);
}

/* Custom Primary Colors */
.bg-primary {
  background-color: var(--primary-color) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: #1B5E20;
  border-color: #1B5E20;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--text-color);
  transition: var(--transition);
}

.btn-secondary:hover {
  background-color: #F57F17;
  border-color: #F57F17;
  transform: translateY(-2px);
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  background-color: white;
}

[data-theme="dark"] .card {
  background-color: #1E1E1E;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  font-weight: bold;
}

/* Person/Soldier Cards */
.person-card, .soldier-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.person-card .card-img-top, .soldier-card .card-img-top {
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.person-card:hover .card-img-top, .soldier-card:hover .card-img-top {
  transform: scale(1.05);
}

.person-card .card-body, .soldier-card .card-body {
  padding: 1.5rem;
}

.person-card .card-title, .soldier-card .card-title {
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.person-card .card-text, .soldier-card .card-text {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Badges */
.badge {
  font-size: 0.8rem;
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
}

.badge-primary {
  background-color: var(--primary-color);
}

.badge-secondary {
  background-color: var(--secondary-color);
  color: var(--text-color);
}

/* Search Box */
.search-box {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.search-input {
  border: 2px solid #E0E0E0;
  border-radius: 25px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color), #1B5E20);
  color: white;
  padding: 4rem 0;
  margin-bottom: 3rem;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Stats Cards */
.stats-card {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.stats-card:hover {
  transform: translateY(-4px);
}

.stats-card .stats-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stats-card .stats-label {
  color: #666;
  font-size: 1rem;
}

/* Prayer Counter */
.prayer-counter {
  background: var(--secondary-color);
  color: var(--text-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
  margin: 1rem 0;
}

.prayer-counter .counter-number {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Comments Section */
.comments-section {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--card-shadow);
}

.comment-item {
  border-bottom: 1px solid #E0E0E0;
  padding: 1rem 0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-author {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.comment-date {
  font-size: 0.8rem;
  color: #999;
}

.comment-content {
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* Forms */
.form-control {
  border: 2px solid #E0E0E0;
  border-radius: var(--border-radius);
  padding: 0.8rem 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  padding: 0.8rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .stats-card .stats-number {
    font-size: 2rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* Dark Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Focus styles for accessibility */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1B5E20;
}

/* SuperAdmin Styles */
.page-header {
  background: linear-gradient(135deg, var(--primary-color), #1B5E20);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* Statistics Cards */
.border-left-primary {
  border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
  border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
  border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
  border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
  border-left: 0.25rem solid #e74a3b !important;
}

.border-left-secondary {
  border-left: 0.25rem solid #858796 !important;
}

.border-left-dark {
  border-left: 0.25rem solid #5a5c69 !important;
}

.text-xs {
  font-size: 0.7rem;
}

.font-weight-bold {
  font-weight: 700 !important;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-gray-800 {
  color: #5a5c69 !important;
}

.text-gray-300 {
  color: #dddfeb !important;
}

.text-gray-600 {
  color: #858796 !important;
}

/* DataTables RTL */
.dataTables_wrapper {
  direction: rtl;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  direction: rtl;
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5em;
  margin-right: 0;
}

/* Modal Styles */
.modal-header {
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
}

.modal-header .close:hover {
  opacity: 1;
}

/* Alert Styles */
.alert {
  border-radius: var(--border-radius);
  border: none;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Form Validation */
.is-valid {
  border-color: #28a745 !important;
}

.is-invalid {
  border-color: #dc3545 !important;
}

/* Dropdown Menu */
.dropdown-menu {
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  border: none;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--primary-color);
  color: white;
}

.dropdown-item i {
  width: 20px;
  text-align: center;
}

/* List Group */
.list-group-item {
  border: none;
  border-radius: var(--border-radius) !important;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.list-group-item:hover {
  background-color: var(--primary-color);
  color: white;
}

.list-group-item-action {
  cursor: pointer;
}

/* Badge Styles */
.badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

.badge-success {
  background-color: #28a745;
}

.badge-danger {
  background-color: #dc3545;
}

.badge-warning {
  background-color: #ffc107;
  color: #212529;
}

.badge-info {
  background-color: #17a2b8;
}

/* Button Group */
.btn-group .btn {
  margin-left: 0.25rem;
}

.btn-group .btn:first-child {
  margin-left: 0;
}

/* Table Styles */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead th {
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-weight: 600;
}

.table tbody tr {
  transition: var(--transition);
}

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

/* Input Group */
.input-group-text {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #495057;
}

/* SuperAdmin Specific */
.superadmin-card {
  border-left: 4px solid var(--primary-color);
}

.admin-card {
  border-left: 4px solid var(--secondary-color);
}

/* Responsive Tables */
@media (max-width: 768px) {
  .table-responsive {
    border-radius: var(--border-radius);
  }
  
  .btn-group {
    display: flex;
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin-bottom: 0.25rem;
    margin-left: 0;
  }
  
  .btn-group .btn:last-child {
    margin-bottom: 0;
  }
}

/* Gravestone Section - سنگ قبر */
.gravestone-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 3rem 0;
  padding: 2rem 0;
}

.gravestone {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 3px solid #333;
  border-radius: 8px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  padding: 2.5rem 3rem;
  max-width: 600px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.gravestone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.gravestone-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.gravestone-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 3px solid #444;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.9rem;
}

.gravestone-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.gravestone-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}

.gravestone-photo-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.gravestone-name-section {
  text-align: center;
  margin-bottom: 0.5rem;
}

.gravestone-name {
  font-family: 'Noto Nastaliq Urdu', 'Nastaliq', 'IranNastaliq', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgb(178, 104, 51);
  text-align: center;
  line-height: 1.8;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(178, 104, 51, 0.2);
  margin: 0 0 0.5rem 0;
  letter-spacing: 1px;
}

.gravestone-father-name {
  font-family: 'Noto Nastaliq Urdu', 'Nastaliq', 'IranNastaliq', serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: #f0f0f0; /* تقریبا سفید */
  text-align: center;
  line-height: 1.6;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8);
  margin: 0;
  padding-top: 0.3rem;
  opacity: 0.95;
}

.gravestone-dates {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  margin-top: 0.5rem;
}

.gravestone-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Noto Nastaliq Urdu', 'Nastaliq', 'IranNastaliq', serif;
}

.gravestone-date-row:last-child {
  border-bottom: none;
}

.gravestone-date-label {
  color: #aaa;
  font-size: 1rem;
  font-weight: 500;
}

.gravestone-date-value {
  color: #e0e0e0;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Vazir', 'Tahoma', sans-serif;
}

@media (max-width: 768px) {
  .gravestone {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .gravestone-name {
    font-size: 2rem;
  }
  
  .gravestone-father-name {
    font-size: 1.1rem;
  }
  
  .gravestone-photo {
    width: 100px;
    height: 100px;
  }
  
  .gravestone-date-label,
  .gravestone-date-value {
    font-size: 0.9rem;
  }
}