/* === VARIABLES === */
/* Grouped and commented for better readability */
:root {
    /* Primary Colors */
    --color-primary: #10b981;
    --color-primary-dark: #059669;
    --color-primary-light: #a7f3d0;
    --color-primary-bg-hover: #d1fae5;

    /* Text and Background Colors */
    --color-text: #374151;
    --color-text-muted: #6b7280;
    --color-background: #ffffff;
    --color-background-alt: #f9fafb;
    --color-border: #e5e7eb;

    /* Sidebar Colors */
    --color-sidebar-bg: var(--color-background-alt);
    --color-sidebar-text: var(--color-text-muted);
    --color-sidebar-text-active: var(--color-primary);
    --color-sidebar-bg-active: var(--color-primary-bg-hover);
    --color-sidebar-icon: var(--color-text-muted);
    --color-sidebar-icon-active: var(--color-primary);

    /* Header Colors */
    --color-header-bg: var(--color-background);
    --color-header-text: var(--color-text);
    --color-header-border: var(--color-border);

    /* Link Colors */
    --color-link: var(--color-primary);
    --color-link-hover: var(--color-primary-dark);

    /* Code Block Colors */
    --color-code-bg: #f3f4f6;
    --color-code-text: var(--color-text);

    /* Shadows */
    --color-shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px var(--color-shadow), 0 2px 4px -1px var(--color-shadow);
    --shadow-lg: 0 10px 15px -3px var(--color-shadow), 0 4px 6px -2px var(--color-shadow);
    --shadow-xl: 0 20px 25px -5px var(--color-shadow), 0 10px 10px -5px var(--color-shadow);

    /* Fonts */
    --font-primary: 'Montserrat', sans-serif;
    --font-script: 'Segoe Script', cursive;
    --font-code: monospace;

    /* Layout Dimensions */
    --sidebar-width: 256px;
    --header-height: 64px;
}

/* === DARK MODE VARIABLES === */
[data-theme="dark"] {
    /* Adjusted for better readability */
    --color-primary: #10b981;
    --color-primary-dark: #059669;
    --color-primary-light: #064e3b;
    --color-primary-bg-hover: #047857;

    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-background: #111827;
    --color-background-alt: #1f2937;
    --color-border: #374151;

    --color-sidebar-bg: var(--color-background-alt);
    --color-sidebar-text: var(--color-text-muted);
    --color-sidebar-text-active: #ffffff;
    --color-sidebar-bg-active: var(--color-primary-dark);
    --color-sidebar-icon: var(--color-text-muted);
    --color-sidebar-icon-active: #ffffff;

    --color-header-bg: var(--color-background-alt);
    --color-header-text: var(--color-text);
    --color-header-border: var(--color-border);

    --color-link: var(--color-primary);
    --color-link-hover: #34d399;

    --color-code-bg: #374151;
    --color-code-text: #d1d5db;

    --color-shadow: rgba(0, 0, 0, 0.3);
}

/* === BASE STYLES === */
/* Added comments for clarity */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-background);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--color-link-hover);
    outline: none; /* Provide custom focus or rely on browser default */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style-position: inside;
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75em;
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    padding: 1.5rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    z-index: 100;
    border-right: 1px solid var(--color-border);
}

.scrollable-sidebar {
    max-height: 80vh; /* Limits the height to 80% of the viewport */
    overflow-y: auto; /* Enables vertical scrolling */
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.main-header {
    height: var(--header-height);
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-header-border);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background-alt);
    color: var(--color-text);
    margin-right: 0.5rem;
}
.search-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.search-button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
}

.search-button:hover,
.search-button:focus {
    color: var(--color-primary);
    outline: none;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

.main-footer {
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-background-alt);
    font-family: var(--font-script);
}

.logo-container img {
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.05);
}

#sidebar-nav ul {
    list-style: none;
    padding-left: 0;
}

#sidebar-nav li {
    margin-bottom: 0.25rem;
}

#sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: var(--color-sidebar-text);
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

#sidebar-nav a:hover,
#sidebar-nav a:focus {
    background-color: var(--color-sidebar-bg-active);
    color: var(--color-sidebar-text-active);
    outline: none;
}

#sidebar-nav li.active a {
    background-color: var(--color-sidebar-bg-active);
    color: var(--color-sidebar-text-active);
    font-weight: 600;
}

.nav-icon {
    width: 1.25rem;
    margin-right: 0.75rem;
    color: var(--color-sidebar-icon);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

#sidebar-nav a:hover .nav-icon,
#sidebar-nav a:focus .nav-icon,
#sidebar-nav li.active a .nav-icon {
    color: var(--color-sidebar-icon-active);
}

/* Move the theme toggle button to the top-right corner */
.dark-mode-toggle {
    position: fixed; /* Fix the position to the viewport */
    top: 1rem; /* Place it at the top */
    right: 1rem; /* Align it to the right */
    z-index: 1000; /* Ensure it stays above other elements */
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--color-sidebar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    border-radius: 4px; /* Added for focus */
    width: 40px; /* Set a fixed width */
    height: 40px; /* Set a fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; /* Includes padding and border in the size */
    min-width: 40px; /* Ensures a minimum width */
    min-height: 40px; /* Ensures a minimum height */
    padding: 0; /* Removes any additional padding */
}

#theme-toggle:hover,
#theme-toggle:focus {
    color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-light); /* Focus outline */
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-header-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}
.mobile-menu-button:focus {
     outline: none;
     box-shadow: 0 0 0 2px var(--color-primary-light);
}

.card {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-left: 4px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--color-primary);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.section-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.icon {
    margin-right: 0.5rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.link-list {
    list-style: none;
    padding-left: 0;
}

.link-list li a {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.link-list li a i {
    margin-right: 0.5rem;
    color: var(--color-primary-light);
    transition: color 0.2s ease;
    vertical-align: middle;
}

.link-list li a:hover i,
.link-list li a:focus i {
    color: var(--color-primary);
}

.custom-checkbox input[type="checkbox"] {
   display: none;
}

.custom-checkbox label {
   display: flex;
   align-items: center;
   cursor: pointer;
   transition: all 0.3s ease;
   margin-bottom: 1rem;
   font-size: 1.125rem;
}

.custom-checkbox label:before {
   content: '\f00c';
   font-family: "Font Awesome 6 Free";
   font-weight: 900;
   width: 28px;
   height: 28px;
   line-height: 28px;
   text-align: center;
   border: 2px solid var(--color-primary);
   border-radius: 50%;
   margin-right: 1rem;
   color: transparent;
   background-color: var(--color-background);
   transition: all 0.3s ease;
   flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"]:checked + label:before {
   color: var(--color-primary);
   background-color: var(--color-primary-light);
}

.custom-checkbox:hover label:before {
   transform: scale(1.1);
   box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.custom-checkbox input[type="checkbox"]:focus + label:before {
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.click-to-copy {
   cursor: pointer;
   color: var(--color-primary);
   font-weight: 600;
   padding: 2px 6px;
   border-radius: 4px;
   transition: all 0.2s ease;
   margin-left: 0.5rem;
   border: 1px dashed transparent;
   display: inline-block; /* Ensure proper padding */
}

.click-to-copy:hover,
.click-to-copy:focus {
   background-color: var(--color-primary-bg-hover);
   color: var(--color-primary-dark);
   border-color: var(--color-primary-light);
   box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
   outline: none;
}

.click-to-copy:active {
   transform: scale(0.95);
}

.task-step {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.task-number {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    font-weight: 700;
    margin-right: 0.75rem;
    font-size: 1.2em;
    flex-shrink: 0;
}

.task-text {
    font-weight: 500;
}

.step-details {
    list-style: none;
    padding-left: 2.5rem;
    margin-top: 0.5rem;
}

.step-details li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-details li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-size: 1.2em;
    line-height: 1;
}

.column-card {
   background: var(--color-background-alt);
   border: 1px solid var(--color-border);
   border-radius: 8px;
   padding: 1rem;
   margin-bottom: 1rem;
   transition: all 0.3s ease;
   position: relative;
}

.column-card:hover {
   background: var(--color-primary-bg-hover);
   border-color: var(--color-primary);
   transform: translateY(-4px) scale(1.02);
   box-shadow: var(--shadow-md);
}

.column-title {
   font-weight: 700;
   font-size: 1.125rem;
   margin-bottom: 0.5rem;
   display: inline-block;
}

.column-card h3 {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.color-circle {
   width: 1.2rem;
   height: 1.2rem;
   border-radius: 50%;
   margin-right: 0.75rem;
   display: inline-block;
   flex-shrink: 0;
   border: 1px solid rgba(0,0,0,0.1);
}

.color-circle.orange { background-color: #f39c12; }
.color-circle.red    { background-color: #e74c3c; }
.color-circle.black  { background-color: #2c3e50; }
.color-circle.green  { background-color: #27ae60; }
.color-circle.blue   { background-color: #3498db; }

.tooltip {
   position: relative;
   cursor: help;
}

.tooltip .tooltip-text {
   visibility: hidden;
   width: 160px;
   background-color: #333;
   color: #fff;
   text-align: center;
   border-radius: 6px;
   padding: 8px;
   position: absolute;
   z-index: 1;
   bottom: 115%;
   left: 50%;
   margin-left: -80px;
   opacity: 0;
   transition: opacity 0.3s;
   font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
   visibility: visible;
   opacity: 1;
}

.benefits-list,
.activation-list {
    list-style: none;
    padding-left: 0;
}

.benefits-list li,
.activation-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.benefits-list li i,
.activation-list li i {
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--color-primary);
    font-size: 1em; /* Ensure icon size consistency */
    line-height: inherit; /* Inherit line height */
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    user-select: none; /* Prevent text selection on buttons */
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-primary:focus {
    outline: none;
    box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-light);
}

.btn-secondary {
    background-color: var(--color-background-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
    border-color: var(--color-text-muted);
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-bg-hover);
    border-color: var(--color-text-muted);
}

pre, code {
    font-family: var(--font-code);
    font-size: 0.9em;
}

code {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

pre {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    // border: 1px solid var(--color-border);
    margin-bottom: 1em;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    color: inherit;
    font-size: inherit;
}

/* === UTILITY CLASSES === */
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-600 { color: var(--color-text-muted); }
.text-green-700 { color: var(--color-primary-dark); }
.text-emerald-500 { color: var(--color-primary); }

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        width: 256px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-menu-button {
        display: block;
    }
    .main-header {
        padding: 0 1rem;
        justify-content: flex-start;
    }
     .main-header h1 {
        margin-left: 1rem;
        font-size: 1.1rem;
    }
    .header-actions {
        margin-left: auto;
    }
     .search-input {
        width: 100px;
    }
    .content-area {
        padding: 1rem;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    .card { padding: 1rem; }

    body.sidebar-open .main-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-up[data-delay="0s"] { animation-delay: 0s; }
.fade-in-up[data-delay="0.2s"] { animation-delay: 0.2s; }
.fade-in-up[data-delay="0.4s"] { animation-delay: 0.4s; }
.fade-in-up[data-delay="0.6s"] { animation-delay: 0.6s; }
.fade-in-up[data-delay="0.8s"] { animation-delay: 0.8s; }
.fade-in-up[data-delay="1.0s"] { animation-delay: 1.0s; }
.fade-in-up[data-delay="1.2s"] { animation-delay: 1.2s; }
.fade-in-up[data-delay="1.4s"] { animation-delay: 1.4s; }
.fade-in-up[data-delay="1.6s"] { animation-delay: 1.6s; }
.fade-in-up[data-delay="1.8s"] { animation-delay: 1.8s; }

.copy-feedback {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none; /* Prevent interaction */
}

.copy-feedback.show {
    opacity: 1;
}

.quick-nav-button {
  padding: 0.25rem 0.75rem;
  background-color: var(--color-primary-bg-hover); /* Use variable */
  color: var(--color-primary-dark); /* Use variable */
  border-radius: 6px;
  border: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: background-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin: 0.25rem; /* Add small margin if needed */
}

.quick-nav-button:hover {
  background-color: var(--color-primary-light); /* Use variable */
}

.quick-nav-button:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--color-primary); /* Adjusted focus ring color */
}

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
  width: 100%;
}

.data-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
  color: var(--color-text-muted); /* Use variable */
}

.data-table thead tr {
  background-color: var(--color-primary-bg-hover); /* Use variable */
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem; /* Adjusted padding (more space) */
  border: 1px solid var(--color-border); /* Use variable */
  vertical-align: middle;
}

.data-table th {
  font-weight: 600;
  color: var(--color-text); /* Header text darker */
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--color-background-alt); /* Subtle striping */
}
[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05); /* Dark mode striping */
}

