/* --- CSS Variables & Theming --- */
:root {
    --bg-color: #ffffff;
    --text-main: #1f2937; 
    --text-muted: #4b5563;
    --accent: #0696d7; 
    --accent-hover: #047aa5;
    --card-bg: #f9fafb;
    --border: #e5e7eb;
    --placeholder-bg: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-btn: 0 4px 14px 0 rgba(6, 150, 215, 0.39);
}

[data-theme="dark"] {
    --bg-color: #111827;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --card-bg: #1f2937;
    --border: #374151;
    --placeholder-bg: #374151;
    --shadow-btn: 0 4px 14px 0 rgba(6, 150, 215, 0.2);
}

/* --- Global Styles --- */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}
h1, h2, h3, h4 { margin-top: 0; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; color: var(--accent-hover); }

/* --- Top Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}
.logo { font-weight: 800; font-size: 1.25rem; color: var(--accent); white-space: nowrap; }
.main-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap; 
}
.main-nav a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }

/* UX UPGRADE: Modern Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 50px; /* Pill shape */
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.theme-toggle:hover {
    background: var(--border);
    transform: translateY(-1px);
}
.theme-toggle:active {
    transform: translateY(0);
}

/* --- Layout: Sidebar & Main Content --- */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 5%;
    gap: 4rem;
}

/* Sticky Table of Contents */
.toc {
    flex: 0 0 250px;
    position: sticky;
    top: 90px; 
    height: max-content;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.toc h3 { font-size: 1.1rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 0.5rem; }
.toc a { color: var(--text-main); font-weight: 600; padding: 0.25rem 0; }
.toc a:hover { color: var(--accent); text-decoration: none; padding-left: 5px; transition: padding 0.2s; }

.content { flex: 1; min-width: 0; }

/* --- Hero Section & Primary Button UX --- */
.hero { text-align: center; padding: 4rem 0 5rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 1.2rem; }
.hero p { font-size: clamp(1.1rem, 2vw, 1.25rem); color: var(--text-muted); margin-bottom: 2.5rem; max-width: 650px; margin-inline: auto; }

/* UX UPGRADE: Primary Action Button */
.btn-primary {
    background: var(--accent);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover { 
    background: var(--accent-hover); 
    color: white; 
    text-decoration: none; 
    transform: translateY(-3px); /* Lifts up off the page */
    box-shadow: 0 6px 20px rgba(6, 150, 215, 0.45);
}
.btn-primary:active {
    transform: translateY(-1px);
}

/* --- Sections General --- */
section { margin-bottom: 5rem; padding-top: 1rem; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.25rem); border-bottom: 3px solid var(--accent); display: inline-block; padding-bottom: 0.5rem; margin-bottom: 2.5rem; }

/* --- Preparation Grid --- */
.prep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.prep-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.prep-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.prep-card h4 { color: var(--accent); font-size: 1.2rem; margin-bottom: 0.75rem; }

/* --- Step-by-Step Timeline --- */
.step { display: flex; gap: 2rem; margin-bottom: 4rem; }
.step-number {
    flex: 0 0 45px;
    height: 45px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: var(--shadow-sm);
}
.step-content { flex: 1; }
.step-content h3 { font-size: 1.6rem; margin-bottom: 0.75rem; }

/* UX UPGRADE: Image Gallery Grid for Multiple Screenshots */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
/* If there are tons of images (like Step 4), make the grid tighter */
.large-gallery {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tutorial-img {
    width: 100%;                  
    height: 100%;
    max-height: 350px;            
    object-fit: contain;          
    background-color: var(--placeholder-bg); 
    border: 1px solid var(--border);
    border-radius: 8px;           
    box-shadow: var(--shadow-sm); 
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tutorial-img:hover {
    transform: scale(1.03); 
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

/* --- Troubleshooting Accordion --- */
details {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}
details:hover { border-color: var(--accent); }
summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 1.5rem; color: var(--accent); line-height: 1; transition: transform 0.3s; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 1.5rem 1.5rem; margin-top: 0.5rem; color: var(--text-muted); }

/* --- Professional Footer --- */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 4rem 5% 2rem;
    margin-top: 5rem;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}
.footer-section h4 { color: var(--text-main); font-size: 1.15rem; margin-bottom: 1.25rem; }
.footer-section p { color: var(--text-muted); font-size: 0.95rem; }
.footer-section a { display: block; color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.95rem; }
.footer-section a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }

/* =========================================
   IMAGE PREVIEW MODAL (LIGHTBOX)
   ========================================= */
.modal {
    display: none; 
    position: fixed;
    z-index: 9999; 
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(5px); 
    align-items: center;
    justify-content: center;
}
.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    object-fit: contain;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.close-modal {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #f1f1f1;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.close-modal:hover { color: var(--accent); transform: scale(1.1); }
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =========================================
   RESPONSIVE MEDIA QUERIES
   ========================================= */

@media (max-width: 1024px) {
    .container { gap: 2.5rem; }
    .toc { flex: 0 0 220px; }
}

@media (max-width: 850px) {
    /* Stack Header elements */
    header { flex-direction: column; gap: 1.25rem; padding: 1.25rem 5%; }
    .header-left { flex-direction: column; gap: 1.25rem; width: 100%; text-align: center; }
    .main-nav { justify-content: center; gap: 1.25rem; }

    /* Layout adjustments */
    .container { flex-direction: column; padding: 2rem 5%; }
    
    /* Make TOC sit at the top of content */
    .toc { position: static; width: 100%; box-sizing: border-box; margin-bottom: 1rem; }
    
    .hero { padding: 2rem 0 3rem; }
    
    /* Timeline adjustments */
    .step { flex-direction: column; gap: 1.25rem; margin-bottom: 3.5rem; }
    .step-number { margin-bottom: -0.5rem; width: 45px; }

    /* Grid layout adjustments for mobile */
    .image-gallery, .large-gallery {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }
}