/* ==========================================================================
   AlWajibat.com (الواجبات) - Main Stylesheet
   Modern, Clean, High-Performance Educational Design System for Saudi Arabia
   Primary: #15966A | Secondary: #0F766E | RTL First
   ========================================================================== */

:root {
  --primary: #15966A;
  --primary-hover: #107b56;
  --primary-light: #e6f7f0;
  --secondary: #0F766E;
  --secondary-hover: #0d5f58;
  --accent: #EAB308;
  --accent-light: #FEF9C3;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --danger: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.25s ease-in-out;
  --container-max: 1200px;
  --font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
  text-align: right;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility & Focus */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 9999;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.brand-logo:hover {
  color: var(--primary-hover);
}
.brand-badge {
  font-size: 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.5rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Dropdown Menu */
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 1050;
  list-style: none;
}

.dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}
.dropdown-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  padding-right: 1.5rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-search-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}
.header-search-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 0.4rem;
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 50%, #ECFDF5 100%);
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 2.5rem;
}
.hero-content h1 {
  font-size: 2.75rem;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  color: #064E3B;
}
.hero-content p {
  font-size: 1.18rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Hero Search Box */
.hero-search-wrapper {
  background: #fff;
  padding: 0.4rem 0.5rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
}
.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}
.hero-search-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.hero-search-btn:hover {
  background: var(--primary-hover);
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.88rem;
}
.popular-tags span {
  color: var(--text-muted);
  font-weight: 600;
}
.tag-link {
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.tag-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Visual Illustration Card */
.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-card-stack {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.hero-badge-saudi {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #064E3B;
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

/* Sections General */
.section {
  padding: 4rem 0;
}
.section-light {
  background-color: #fff;
}
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.section-header h2 {
  font-size: 2rem;
  color: #064E3B;
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}
.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: var(--radius-full);
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.5rem;
}

/* Stage Cards Grid */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.stage-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.stage-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: var(--primary);
}
.stage-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}
.stage-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.stage-card p {
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 1.5rem;
}
.stage-grades {
  list-style: none;
  margin-bottom: 1.5rem;
  padding: 0;
}
.stage-grades li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stage-grades li::before {
  content: '✓';
  color: var(--primary);
  font-weight: bold;
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}
.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--secondary-hover);
  color: #fff;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Subject Grid */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.subject-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: var(--transition);
  display: block;
}
.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.subject-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--primary);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}
.subject-card:hover .subject-icon {
  background: var(--primary);
  color: #fff;
}
.subject-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}
.subject-card span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Resources Grid */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.resource-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.resource-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.resource-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}
.resource-semester {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.resource-card h3, .resource-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.resource-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 1.25rem;
}
.resource-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 0.85rem;
  margin-top: auto;
}

/* Tools Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.tool-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

/* Features / Why Choose Us */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.feature-item {
  text-align: center;
  padding: 1.5rem;
}
.feature-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem;
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: var(--transition);
}
.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  text-align: right;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.faq-question:hover {
  color: var(--primary);
}
.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}
.faq-item.active .faq-icon {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.3s ease;
  padding: 0 1.5rem;
  color: var(--text-secondary);
}
.faq-item.active .faq-answer {
  padding: 0 1.5rem 1.25rem;
  max-height: 400px;
}

/* AdSense Placeholder Container */
.ad-slot-container {
  margin: 2.5rem 0;
  padding: 1.25rem;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.ad-placeholder-box {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Breadcrumbs */
.breadcrumbs {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  font-size: 0.88rem;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}
.breadcrumb-item a {
  color: var(--text-muted);
}
.breadcrumb-item a:hover {
  color: var(--primary);
}
.breadcrumb-separator {
  color: var(--border);
}
.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Page Header Standard */
.page-header {
  background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 2.25rem;
  color: #064E3B;
  margin-bottom: 0.75rem;
}
.page-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin-bottom: 0;
}

/* Content Layout (Article + Sidebar) */
.content-layout {
  display: grid;
  grid-template-columns: 2.7fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.main-article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}
.main-article h2 {
  font-size: 1.6rem;
  color: #064E3B;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}
.main-article h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  color: var(--secondary);
}
.main-article ul, .main-article ol {
  margin-bottom: 1.5rem;
  padding-right: 1.5rem;
  color: var(--text-secondary);
}
.main-article li {
  margin-bottom: 0.5rem;
}

/* Step-by-Step Solutions Box */
.solution-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-right: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.solution-box h4 {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Disclaimer Callout Box */
.callout-disclaimer {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-right: 4px solid var(--warning);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #92400E;
  margin: 1.5rem 0;
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-size: 1.15rem;
  color: #064E3B;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.widget-list {
  list-style: none;
}
.widget-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.widget-list li:last-child {
  border-bottom: none;
}
.widget-list a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.widget-list a:hover {
  color: var(--primary);
  padding-right: 0.25rem;
}

/* Footer */
.site-footer {
  background: #0F172A;
  color: #94A3B8;
  margin-top: auto;
  border-top: 1px solid #1E293B;
}
.footer-top {
  padding: 4.5rem 0 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand h3 {
  color: #fff;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
.footer-brand p {
  color: #94A3B8;
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 2px;
  background: var(--primary);
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.65rem;
}
.footer-links a {
  color: #94A3B8;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: #fff;
  padding-right: 0.25rem;
}
.footer-bottom {
  border-top: 1px solid #1E293B;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #64748B;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 990;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}

/* Tool Interactive Styles */
.tool-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}
.tool-form-group {
  margin-bottom: 1.25rem;
}
.tool-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.tool-input, .tool-select, .tool-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}
.tool-input:focus, .tool-select:focus, .tool-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.tool-result-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
}
.tool-result-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.5rem 0;
}

/* Flashcard styles */
.flashcard-wrapper {
  perspective: 1000px;
  max-width: 500px;
  margin: 2rem auto;
  height: 260px;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}
.flashcard-inner.flipped {
  transform: rotateY(180deg);
}
.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary-light);
}
.flashcard-front {
  background: #fff;
  color: var(--text-primary);
}
.flashcard-back {
  background: var(--primary);
  color: #fff;
  transform: rotateY(180deg);
}
