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

:root {
  --primary: #0f9d6e;
  --primary-dark: #0b7a55;
  --primary-light: #e8f5f0;
  --primary-gradient: linear-gradient(135deg, #0f9d6e 0%, #0b7a55 100%);
  --secondary: #8b5cf6;
  --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #ffffff;
  --bg-surface: #f3f4f6;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-light: #9ca3af;
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-card: #1f2937;
  --bg-surface: #374151;
  --border: #374151;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  overflow-x: hidden;
}

/* Header Styles */
.doa-header {
  background: var(--primary-gradient);
  position: relative;
  padding: 32px 20px 48px;
  overflow: hidden;
}

.header-decoration {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.header-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  backdrop-filter: blur(10px);
  animation: slideInLeft 0.5s ease;
}

.header-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.header-title h1 span {
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-title p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.header-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
}

.header-wave svg {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Search Container */
.search-container {
  padding: 20px;
  background: var(--bg-primary);
  position: relative;
  z-index: 2;
}

.search-box {
  background: var(--bg-secondary);
  border-radius: 60px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 157, 110, 0.1);
  transform: translateY(-2px);
}

.search-icon {
  color: var(--text-light);
  font-size: 18px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.clear-search {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 18px;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
}

.clear-search.visible {
  opacity: 1;
  visibility: visible;
}

.search-stats {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-left: 8px;
}

/* Tasbih Section Premium */
.tasbih-section {
  margin: 0 20px 20px;
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.tasbih-section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.tasbih-header {
  padding: 16px 20px;
  background: var(--primary-gradient);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tasbih-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 600;
}

.tasbih-title i {
  font-size: 20px;
}

.tasbih-preset {
  display: flex;
  gap: 8px;
}

.tasbih-preset span {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.tasbih-preset span:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.tasbih-main {
  padding: 30px 20px;
  text-align: center;
}

.zikr-container {
  margin-bottom: 30px;
}

.zikr-text {
  font-family: 'Amiri', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  direction: rtl;
}

.zikr-translation {
  font-size: 14px;
  color: var(--text-secondary);
}

.tasbih-counter-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.tasbih-counter-wrapper {
  position: relative;
}

.tasbih-counter-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  stroke: var(--bg-surface);
  stroke-width: 8;
  fill: none;
}

.progress-ring-fill {
  stroke: var(--primary);
  stroke-width: 8;
  fill: none;
  stroke-dasharray: 502.4;
  stroke-dashoffset: 502.4;
  transition: stroke-dashoffset 0.3s ease;
  stroke-linecap: round;
}

.tasbih-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
}

.tasbih-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.tasbih-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tasbih-plus {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow);
}

.tasbih-plus:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.tasbih-minus {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.tasbih-minus:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.05);
}

.tasbih-reset {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.tasbih-reset:hover {
  background: var(--warning);
  color: white;
  transform: scale(1.05);
}

.tasbih-footer {
  padding: 16px 20px;
  background: var(--bg-secondary);
}

.tasbih-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Category Section */
.category-section {
  padding: 0 20px 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.category-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.category-tabs::-webkit-scrollbar {
  height: 3px;
}

.category-btn {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-btn i {
  font-size: 12px;
}

.category-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.category-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow);
}

/* Doa List Container */
.doa-list-container {
  padding: 0 20px 20px;
}

.doa-list-header {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doa-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Doa Card Premium */
.doa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.doa-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.doa-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-lg);
}

.doa-card:hover::before {
  transform: scaleY(1);
}

.doa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.doa-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.doa-card-category {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 500;
}

.doa-card-arabic {
  font-family: 'Amiri', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  direction: rtl;
  text-align: right;
}

.doa-card-meaning {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doa-card-footer {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--text-light);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-results i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

/* Modal Styles */
.doa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.doa-modal.show {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  background: var(--bg-card);
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-xl);
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: var(--primary-gradient);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  color: white;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px;
  max-height: 55vh;
  overflow-y: auto;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

.modal-arabic {
  font-family: 'Amiri', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

.modal-latin {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
}

.modal-meaning {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-benefit {
  background: var(--primary-light);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--primary-dark);
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.modal-copy-btn,
.modal-share-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-copy-btn {
  background: var(--primary-gradient);
  color: white;
}

.modal-copy-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.modal-share-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.modal-share-btn:hover {
  background: var(--secondary);
  color: white;
  transform: scale(1.02);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 99;
}

.back-to-top:hover {
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 480px) {
  .header-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .header-title h1 {
    font-size: 22px;
  }
  
  .tasbih-buttons {
    flex-wrap: wrap;
  }
  
  .tasbih-btn {
    flex: 1;
    justify-content: center;
  }
  
  .doa-card-title {
    font-size: 16px;
  }
  
  .modal-arabic {
    font-size: 22px;
  }
  
  .category-btn span {
    display: none;
  }
  
  .category-btn i {
    font-size: 16px;
  }
  
  .category-btn {
    padding: 10px 16px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}