/* ========== Theme System ========== */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --hover-bg: #fff7ed;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --hover-bg: rgba(255, 107, 0, 0.1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4);
}

* {
  font-family: "Vazirmatn FD NL", "Vazirmatn", system-ui, sans-serif;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-border {
  0%,
  100% {
    border-color: rgba(255, 107, 0, 0.3);
  }
  50% {
    border-color: rgba(255, 107, 0, 0.8);
  }
}

.fade-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.fade-scale {
  animation: fadeInScale 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}

.float-animation {
  animation: float 4s ease-in-out infinite;
}

.spin-slow {
  animation: spin-slow 20s linear infinite;
}

.theme-transition {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Content Styles */
.terms-section {
  scroll-margin-top: 100px;
}

.terms-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

.terms-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 107, 0, 0.3);
}

.sidebar-link {
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6b00, #e83e8c);
  transition: width 0.3s ease;
}

.sidebar-link:hover {
  color: #ff6b00;
  padding-right: 1.5rem;
}

.sidebar-link:hover::before {
  width: 0.75rem;
}

.sidebar-link.active {
  color: #ff6b00;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 0, 0.1),
    rgba(232, 62, 140, 0.1)
  );
  border-radius: 0.5rem;
  padding-right: 1.5rem;
}

.sidebar-link.active::before {
  width: 0.75rem;
}

/* List Styles */
.terms-list {
  list-style: none;
  padding: 0;
}

.terms-list li {
  position: relative;
  padding-right: 1.75rem;
  margin-bottom: 0.75rem;
}

.terms-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 0;
  top: 0.25rem;
  color: #22c55e;
  font-size: 0.75rem;
}

.terms-list.warning li::before {
  content: "\f071";
  color: #f59e0b;
}

.terms-list.danger li::before {
  content: "\f06a";
  color: #ef4444;
}

/* Info Box */
.info-box {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.05),
    rgba(108, 43, 217, 0.05)
  );
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.warning-box {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.05),
    rgba(234, 179, 8, 0.05)
  );
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.danger-box {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.05),
    rgba(220, 38, 38, 0.05)
  );
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Back to Top Button */
#backToTop {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#backToTop:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px -5px rgba(255, 107, 0, 0.4);
}

/* Last Updated Badge */
.update-badge {
  animation: pulse-border 2s ease-in-out infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ff6b00, #e83e8c);
  border-radius: 10px;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .terms-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}
