/* Typingram Global Responsive Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #0f172a;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --secondary: #f8fafc;
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --border-color: #232d42;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.6);
}

/* RTL Support for Arabic */
body.rtl-mode {
  direction: rtl;
  text-align: right;
}

body.rtl-mode .navbar-brand {
  margin-left: 0;
  margin-right: auto;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
header.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #10b981);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
  box-shadow: 0 2px 4px rgba(37,99,235,0.3);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-name span {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 15px;
  list-style: none;
}

.nav-item-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-trigger::after {
  content: "▾";
  font-size: 0.8rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  z-index: 1000;
  list-style: none;
}

.nav-item-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item a {
  display: block;
  padding: 8px 18px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.dropdown-item a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  padding-left: 22px;
}

.nav-link {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-select, .theme-toggle-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

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

/* Hero Section */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(37,99,235,0.05) 0%, transparent 100%);
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 1.75rem;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.badge-featured {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37,99,235,0.06);
}

/* Grid & Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--accent);
  color: #fff;
}

/* Guide Content Styles (Strictly No Emojis, Clean H2 H3 H4) */
.guide-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-sm);
}

.guide-article h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.75rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-color);
}

.guide-article h2:first-child {
  margin-top: 0;
}

.guide-article h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.4rem 0 0.6rem;
}

.guide-article h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.1rem 0 0.4rem;
}

.guide-article p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.guide-article ul, .guide-article ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.guide-article li {
  margin-bottom: 0.5rem;
}

.table-responsive {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table.guide-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

table.guide-table th, table.guide-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
}

table.guide-table th {
  background: rgba(37,99,235,0.06);
  font-weight: 700;
  color: var(--text-main);
}

/* Footer */
footer.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem 0;
    gap: 15px;
  }
  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .guide-article {
    padding: 1.5rem;
  }
}
