/* =====================================================
   SONIC'S ELIXIR - GUIDE STYLES
   ===================================================== */

/* -----------------------------------------------------
   1. GUIDE SECTION LAYOUT
   ----------------------------------------------------- */
.guide {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.guide__header {
    margin-bottom: var(--space-3xl);
}

.guide__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    max-width: var(--container-2xl);
    margin-inline: auto;
    padding-inline: var(--space-lg);
}

@media (min-width: 64em) {
    .guide__container {
        grid-template-columns: 250px 1fr; /* Sidebar width + content */
    }
}

/* -----------------------------------------------------
   2. GUIDE SIDEBAR & NAVIGATION
   ----------------------------------------------------- */
.guide__sidebar {
    position: relative;
}

@media (min-width: 64em) {
    .guide__sidebar {
        position: sticky;
        top: 120px; /* Header height + some space */
        align-self: start;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
}

.guide__nav {
    background: var(--surface-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-lg);
}

.guide__nav-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--fs-500);
    font-weight: 700;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.guide__nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.guide__nav-link {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    border-left: 2px solid transparent;
}

.guide__nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.guide__nav-link.active {
    color: var(--clr-primary-400);
    font-weight: 700;
    background-color: rgba(14, 165, 233, 0.1);
    border-left-color: var(--clr-primary-400);
}


/* -----------------------------------------------------
   3. GUIDE CONTENT STYLING
   ----------------------------------------------------- */
.guide__content {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    padding: clamp(var(--space-lg), 5vw, var(--space-2xl));
}

.guide__chapter {
    padding-bottom: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.guide__chapter:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide__chapter h2 {
    font-size: var(--fs-700);
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--clr-primary-400) 0%, var(--clr-accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent; /* Standard property */
}

.guide__subtitle {
    font-size: var(--fs-600);
    font-weight: 600;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.guide__content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-md);
    max-width: 75ch;
}

/* Code blocks and inline code */
.code-inline {
    font-family: 'SF Mono', 'Fira Code', 'monospace';
    background: rgba(14, 165, 233, 0.1);
    color: var(--clr-primary-400);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
}

/* Step-by-step lists */
.guide__steps {
    list-style: none;
    counter-reset: steps-counter;
    padding-left: 0;
    margin-top: var(--space-lg);
}

.guide__steps li {
    counter-increment: steps-counter;
    position: relative;
    padding-left: 2.5em;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide__steps li::before {
    content: counter(steps-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.8em;
    height: 1.8em;
    line-height: 1.8em;
    text-align: center;
    border-radius: 50%;
    background: var(--clr-primary-500);
    color: white;
    font-weight: 700;
    font-size: 0.9em;
}

/* Generic lists */
.guide__list {
    list-style-type: none;
    padding-left: 0;
    margin-top: var(--space-lg);
}

.guide__list li {
    position: relative;
    padding-left: 1.75em;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide__list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--clr-primary-400);
    font-weight: bold;
}

/* Tables */
.guide__table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    font-size: var(--fs-300);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.guide__table th, .guide__table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.guide__table thead {
    background: rgba(255, 255, 255, 0.05);
}

.guide__table th {
    color: var(--text-primary);
    font-weight: 600;
}

.guide__table td {
    color: var(--text-secondary);
}

.guide__table tr:last-child td {
    border-bottom: none;
}

.guide__table td strong {
    color: var(--text-primary);
}

/* -----------------------------------------------------
   4. CALLOUTS & SCREENSHOTS
   ----------------------------------------------------- */
.callout {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    border-radius: var(--radius-lg);
    border-left: 4px solid;
}

.callout--info {
    background: rgba(14, 165, 233, 0.05);
    border-color: var(--clr-primary-400);
}

.callout--warn {
    background: rgba(255, 193, 7, 0.05);
    border-color: var(--clr-accent-yellow);
}

.callout__icon {
    font-size: var(--fs-600);
    flex-shrink: 0;
    margin-top: 0.2em;
}

.callout__title {
    font-size: var(--fs-500);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.callout__content p {
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.7;
    max-width: 65ch;
}

.guide__screenshot {
    background: var(--surface-secondary);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin: var(--space-xl) 0;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.guide__screenshot-caption {
    font-style: italic;
    font-size: var(--fs-200);
    margin: 0;
}

.guide__screenshot img {
    display: block;
    width: 100%; /* L'immagine riempie il suo contenitore */
    height: auto; /* Mantiene le proporzioni corrette */
    max-width: 100%;
    border-radius: var(--radius-lg); /* Arrotonda gli angoli dell'immagine per un look più curato */
}

/* Mobile responsive guide navigation */
@media (max-width: 63.999em) {
    .guide__sidebar {
        margin-bottom: var(--space-xl);
    }
    
    .guide__content {
        padding: var(--space-lg);
    }
}