/*
      * General Styles for the website.
      * This stylesheet provides a clean, professional look
      * and ensures the site is responsive on different devices.
      */
:root {
  --primary-color: #3b82f6; /* Tailwind's blue-500 */
  --secondary-color: #1f2937; /* Tailwind's gray-800 */
  --text-color: #4b5563; /* Tailwind's gray-600 */
  --bg-color: #f3f4f6; /* Tailwind's gray-100 */
  --card-bg: #ffffff;
  --border-color: #e5e7eb; /* Tailwind's gray-200 */
  --code-bg: #e2e8f0; /* A light, clean background for code */
  --output-bg: #111827; /* A dark background for output */
}
body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  /* Disable text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.5rem;
}
header {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}
header.ribbon-header {
  position: relative;
  background-color: var(--secondary-color);
  color: #fff;
  /* padding: 2rem 1.5rem; */
  padding: 1rem 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  z-index: 1;
  overflow: hidden;
}

/* Add ribbon tails using pseudo-elements */
header.ribbon-header::before,
header.ribbon-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  width: 40px;
  height: 40px;
  background-color: var(--secondary-color);
  z-index: -1;
}

/* Left ribbon tail */
header.ribbon-header::before {
  left: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Right ribbon tail */
header.ribbon-header::after {
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0 1rem;
}
.nav-links a:hover {
  color: var(--primary-color);
}
.card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  margin-top: 1.5rem;
}
h2,
h3,
h4 {
  color: var(--secondary-color);
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.25rem;
}
p,
ul,
li {
  margin-top: 0.5rem;
}
ul {
  padding-left: 1.5rem;
  list-style: disc;
}
li {
  margin-bottom: 0.5rem;
}
a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
}
.button-link {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1.5rem;
  transition: background-color 0.3s, transform 0.2s;
}
.button-link:hover {
  background-color: #2563eb; /* A slightly darker shade of blue */
  transform: translateY(-2px);
  text-decoration: none;
}
footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: #6b7280; /* Tailwind's gray-500 */
}
footer .container {
  display: flex;
  justify-content: space-between;
}
footer .container p {
  margin: 0;
}
footer .container a {
  color: #6b7280;
}
/* Custom styles for code and output blocks */
.code-block {
  background-color: var(--code-bg);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Enable text selection for code blocks only */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
.code-block code {
  display: block;
  font-family: "Fira Code", "Roboto Mono", monospace;
  font-size: 0.9rem;
  color: var(--secondary-color);
  line-height: 1.5;
}
.output-block {
  background-color: var(--output-bg);
  color: white;
  border-radius: 0.75rem;
  margin-top: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.output-block p {
  margin: 0;
  font-family: "Fira Code", "Roboto Mono", monospace;
  font-size: 0.9rem;
}

/* Keywords Grid Styles */
.keywords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.keyword-category {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
}

.keyword-category h5 {
  margin-top: 0;
  color: #495057;
  border-bottom: 2px solid #6c757d;
  padding-bottom: 5px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword {
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Fira Code", monospace;
}

/* Quick Reference Grid */
.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.reference-grid div {
  background: #e8f4fd;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  border-left: 3px solid #007bff;
}

/* Practice Tip Styling */
.practice-tip {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.practice-tip h4 {
  margin-top: 0;
  color: #0c5460;
}

.important-note {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.important-note h4 {
  margin-top: 0;
  color: #856404;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  header h1 {
    font-size: 2rem;
  }
  .card {
    padding: 1rem;
  }
   header.ribbon-header::before,
  header.ribbon-header::after {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   RIBBON HEADER WITH MENU NAVIGATION BAR
───────────────────────────────────────────── */

.ribbon-header {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  position: relative;
  text-align: center;
  z-index: 10;
  margin-bottom: 2rem;
  overflow: hidden;
}

.ribbon-header h1 {
  margin: 0.5rem 0 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

/* Optional: Decorative Ribbon Tails */
.ribbon-header::before,
.ribbon-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  width: 40px;
  height: 40px;
  background-color: var(--secondary-color);
  z-index: -1;
}

.ribbon-header::before {
  left: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ribbon-header::after {
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* ─────────────────────────────────────────────
   NAVIGATION MENU (INSIDE HEADER)
───────────────────────────────────────────── */

.navBar__menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 0 1rem;
  padding: 0;
}

.navBar__menu li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.3s ease;
}

.navBar__menu li a:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* ─────────────────────────────────────────────
   RESPONSIVE HEADER
───────────────────────────────────────────── */
@media (max-width: 768px) {
  .navBar__menu ul {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .ribbon-header h1 {
    font-size: 1.75rem;
  }

  .ribbon-header::before,
  .ribbon-header::after {
    display: none;
  }
}

/* Responsive: Stack menu on smaller screens */
@media (max-width: 768px) {
  .navBar__menu ul {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .ribbon-header h1 {
    font-size: 1.5rem;
  }
}

/* Syntax Block Styling */
.syntax-block {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  font-family: "Fira Code", monospace;
  border-left: 4px solid #007bff;
}

/* Flowchart Styling */
.flowchart {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.flowchart-step {
  background: #007bff;
  color: white;
  padding: 10px;
  border-radius: 5px;
  margin: 5px auto;
  display: inline-block;
  min-width: 150px;
}

.flowchart-condition {
  background: #28a745;
  color: white;
  padding: 8px;
  border-radius: 5px;
  margin: 5px auto;
  display: inline-block;
  min-width: 80px;
}

.flowchart-arrow {
  margin: 5px 0;
  font-size: 1.2em;
}

.flowchart-branch {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 10px 0;
}

.flowchart-path {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #dee2e6;
  padding: 12px;
  text-align: left;
}

.comparison-table th {
  background: #007bff;
  color: white;
}

.comparison-table tr:nth-child(even) {
  background: #f8f9fa;
}

/* Summary Items */
.summary-points {
  display: grid;
  gap: 15px;
  margin: 20px 0;
}

.summary-item {
  background: #e8f4fd;
  border: 1px solid #b6d7fe;
  border-radius: 8px;
  padding: 15px;
}

.summary-item h4 {
  margin-top: 0;
  color: #0056b3;
}

/* Warning Note */
.warning-note {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.warning-note h4 {
  margin-top: 0;
  color: #721c24;
}

/* Navigation Links */
/* .nav-links {
            margin-bottom: 10px;
        }

        .nav-links a {
            color: #007bff;
            text-decoration: none;
        }

        .nav-links a:hover {
            text-decoration: underline;
        } */

.advantages,
.disadvantages {
  /* margin-top: 10px; */
  padding: 2px;
  border-left: 4px solid;
  border-radius: 5px;
}
.advantages {
  border-color: #27ae60;
  background: #ecf9f1;
}
.disadvantages {
  border-color: #c0392b;
  background: #fdecea;
}

/* CSS for Memory Layout Visualization  */
.memory-layout {
  border: 2px solid #333;
  margin: 20px 0;
  font-family: "Fira Code", monospace;
}

.memory-section {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

.code-section {
  background-color: #e8f4fd;
  color: #0066cc;
}

.data-section {
  background-color: #e8f5e8;
  color: #228b22;
}

.heap-section {
  background-color: #fff0f0;
  color: #dc143c;
}

.stack-section {
  background-color: #fff8dc;
  color: #b8860b;
}

.environment-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.environment-type {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.compilation-steps .step {
  margin: 15px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-left: 4px solid #0066cc;
}

/* Copy protection notification */
.copy-protection-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
}


.image-placeholder img {
  width: 100%;
  max-width: 600px;
  display: block;
  margin: 0 auto;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Copy button styles for code blocks */
.code-block {
  position: relative;
  background-color: var(--code-bg);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Enable text selection for code blocks only */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: white;
  font-family: "Inter", sans-serif;
}

.copy-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: #10b981; /* Green color for success state */
  opacity: 1;
}

.copy-btn.copied::after {
  content: "Copied!";
  margin-left: 4px;
}

.copy-icon {
  width: 16px;
  height: 16px;
  background-image: url("./Icons/1214959_copy_duplicate_icon.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* If you want to use Font Awesome instead of image */
.copy-btn .fa-copy {
  font-size: 14px;
}

/* Copy protection notification */
.copy-protection-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
}

#print-watermark-overlay {
  display: none; /* Hide by default */
}
.print-header {
  display: none;
}

@media print {
  #print-watermark-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
  }

  .ribbon-header {
    display: none !important;
  }
  /* Show the print-only header */
  .print-header {
    display: block !important;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 1rem;
  }

  .watermark {
    position: absolute;
    color: rgba(0, 0, 0, 0.1);
    font-size: 20px;
    font-weight: bold;
    transform: rotate(-30deg);
    white-space: nowrap;
    user-select: none;
  }
  .navBar__menu ul {
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  .navBar__menu li {
    display: inline-block !important;
  }

  .navBar__menu li a {
    font-size: 0.9rem !important;
    padding: 0.25rem 0.5rem !important;
  }

 

  .ribbon-header {
    padding: 0.5rem 0.25rem !important; /* even thinner for print */
  }

  .ribbon-header h1 {
    font-size: 1.1rem !important;
    margin: 0 !important;
  }

  /* Optional: remove ribbon tails on print */
  .ribbon-header::before,
  .ribbon-header::after {
    display: none !important;
  }
}
