/* Nova Music Documentation Portal - Universal Responsive Styles */

:root {
  --primary: #9c27b0;
  --primary-light: #ba68c8;
  --primary-dark: #6a1b9a;
  --accent-cyan: #00e5ff;
  --accent-pink: #ff007f;
  --bg-main: #0c0814;
  --bg-card: #161024;
  --bg-sidebar: #120c1e;
  --bg-code: #1e1633;
  --text-main: #f3f0f8;
  --text-muted: #a49bb5;
  --text-dim: #796f8c;
  --border-color: rgba(156, 39, 176, 0.25);
  --border-glow: rgba(0, 229, 255, 0.4);
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-code: "Fira Code", "Courier New", monospace;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #f8f6fc;
  --bg-card: #ffffff;
  --bg-sidebar: #f0ebf7;
  --bg-code: #251d38;
  --text-main: #1d152c;
  --text-muted: #5e5372;
  --text-dim: #8b809f;
  --border-color: rgba(156, 39, 176, 0.18);
  --shadow: 0 4px 20px rgba(156, 39, 176, 0.08);
}

* {
  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;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Header */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(18, 12, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  gap: 12px;
}

[data-theme="light"] .top-header {
  background: rgba(240, 235, 247, 0.95);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-pink), var(--primary));
  color: #fff;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

/* Search Box */
.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Controls & Buttons */
.control-btn, .lang-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.control-btn:hover, .lang-select:hover {
  border-color: var(--primary-light);
  background: var(--primary-dark);
  color: #fff;
}

/* Mobile Menu Hamburger Button Styling */
.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 40px;
  min-height: 40px;
}

.mobile-menu-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.mobile-menu-btn svg {
  display: block;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  inset-inline-start: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-inline-end: 1px solid var(--border-color);
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 950;
  transition: transform 0.3s ease;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 700;
  margin: 16px 10px 8px 10px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(156, 39, 176, 0.12);
  color: var(--text-main);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(156, 39, 176, 0.3), rgba(0, 229, 255, 0.1));
  color: var(--accent-cyan);
  font-weight: 700;
  border-inline-start: 4px solid var(--accent-cyan);
}

/* Main Content Area */
.main-content {
  margin-top: var(--header-height);
  margin-inline-start: var(--sidebar-width);
  flex: 1;
  padding: 32px;
  max-width: 1200px;
  width: calc(100% - var(--sidebar-width));
}

/* Hero Section */
.doc-hero {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.25), rgba(0, 229, 255, 0.15));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}

.doc-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .doc-title {
  background: linear-gradient(90deg, var(--primary-dark), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.doc-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

/* Grid Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

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

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 14px;
}

.card-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Content Sections */
.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

h2.section-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

p.section-text {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.9rem;
}

/* Step List */
.step-list {
  list-style: none;
  margin: 16px 0;
}

.step-item {
  margin-bottom: 16px;
}

.step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

/* Code Snippets */
.code-box {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin: 14px 0;
  overflow: hidden;
}

.code-header {
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-code);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
}

pre code {
  display: block;
  padding: 12px;
  font-family: var(--font-code);
  font-size: 0.82rem;
  color: #e0d6f5;
  overflow-x: auto;
  line-height: 1.4;
  direction: ltr;
  text-align: left;
}

/* Callout Box Styling */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.92rem;
}

.callout-info {
  background: rgba(0, 229, 255, 0.08);
  border-inline-start: 4px solid var(--accent-cyan);
  color: var(--text-main);
}

.callout-warning {
  background: rgba(255, 193, 7, 0.08);
  border-inline-start: 4px solid #ffc107;
  color: var(--text-main);
}

/* Tables Responsive Wrapper */
.doc-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  width: 100%;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--bg-card);
}

.doc-table th, .doc-table td {
  padding: 10px 12px;
  text-align: start;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.doc-table th {
  background: rgba(156, 39, 176, 0.15);
  color: var(--text-main);
  font-weight: 700;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  background: var(--accent-cyan);
  color: #000;
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Smartphone Mockup Frame */
.phone-mockup {
  position: relative;
  display: inline-block;
  max-width: 280px;
  width: 100%;
  margin: 12px auto;
  background: #111827;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(156, 39, 176, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .phone-mockup {
  background: #f1f5f9;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(156, 39, 176, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.phone-mockup:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 229, 255, 0.4);
}

.phone-mockup img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 26px;
  object-fit: cover;
}

/* Footer */
.doc-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  gap: 12px;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

/* Media Queries for Mobile & Responsive Adaptation */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  /* دعم كلا الكلاسين لمنع أي مشكلة في التجاوب */
  .sidebar.mobile-open,
  .sidebar.active {
    transform: translateX(0) !important;
  }

  .main-content {
    margin-inline-start: 0;
    width: 100%;
    padding: 20px 16px;
  }

  .search-box {
    width: 150px;
  }
}

@media (max-width: 600px) {
  .top-header {
    padding: 0 12px;
  }

  .search-box {
    display: none;
  }

  .brand-badge {
    display: none;
  }

  .doc-hero {
    padding: 20px;
  }

  .doc-title {
    font-size: 1.4rem;
  }

  .section-block {
    padding: 16px;
  }

  .doc-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
