/* ==========================================================================
   Guide Markdown Styles
   Professionelles Styling für Markdown-basierte Ratgeber
   ========================================================================== */

/* --------------------------------------------------------------------------
   Table of Contents (TOC)
   -------------------------------------------------------------------------- */
.guide-toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.guide-toc__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.guide-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-toc__item {
    margin: 0.5rem 0;
}

.guide-toc__item a {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.guide-toc__item a:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.guide-toc__item a::before {
    content: "→";
    margin-right: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.guide-toc__item--sub {
    padding-left: 1.5rem;
}

.guide-toc__item--sub a {
    font-size: 0.9rem;
    color: #64748b;
}

.guide-toc__item--sub a::before {
    content: "↳";
}

/* --------------------------------------------------------------------------
   Info/Warning/Tip/Danger Boxes
   -------------------------------------------------------------------------- */
.guide-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.guide-box__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.guide-box__content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.guide-box__content p {
    margin: 0;
}

.guide-box__content p + p {
    margin-top: 0.75rem;
}

/* Info Box - Blau */
.guide-box--info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    color: #1e40af;
}

/* Warning Box - Gelb/Orange */
.guide-box--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
    color: #92400e;
}

/* Tip Box - Grün */
.guide-box--tip {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
    color: #065f46;
}

/* Danger Box - Rot */
.guide-box--danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
    color: #991b1b;
}

/* --------------------------------------------------------------------------
   Markdown Content Styling
   -------------------------------------------------------------------------- */
.guide-content {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.75;
    color: #374151;
}

.guide-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.2;
}

.guide-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 2.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    line-height: 1.3;
}

.guide-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #374151;
    margin: 2rem 0 0.75rem 0;
    line-height: 1.4;
}

.guide-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #4b5563;
    margin: 1.5rem 0 0.5rem 0;
}

.guide-content p {
    margin: 1rem 0;
}

.guide-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.guide-content a:hover {
    color: #1d4ed8;
}

.guide-content strong {
    font-weight: 600;
    color: #1f2937;
}

.guide-content em {
    font-style: italic;
}

/* Lists */
.guide-content ul,
.guide-content ol {
    margin: 1rem 0;
    padding-left: 1.75rem;
}

.guide-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.guide-content ul li::marker {
    color: #3b82f6;
}

.guide-content ol li::marker {
    color: #3b82f6;
    font-weight: 600;
}

/* Tables */
.guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.guide-content thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.guide-content th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
}

.guide-content td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #475569;
}

.guide-content tbody tr:hover {
    background: #f8fafc;
}

.guide-content tbody tr:last-child td {
    border-bottom: none;
}

/* Code */
.guide-content code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.875em;
}

.guide-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.guide-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* Blockquotes */
.guide-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
}

.guide-content blockquote p {
    margin: 0;
}

/* Images */
.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Horizontal Rule */
.guide-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 2.5rem 0;
}

/* --------------------------------------------------------------------------
   Figure with Caption and Source
   -------------------------------------------------------------------------- */
.guide-figure {
    margin: 2rem 0;
    padding: 0;
}

.guide-figure__image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

.guide-figure__caption {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 12px 12px;
    margin-top: -8px;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.guide-figure__text {
    font-size: 0.95rem;
    color: #374151;
    font-style: italic;
}

.guide-figure__source {
    font-size: 0.8rem;
    color: #6b7280;
}

.guide-figure__source a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.guide-figure__source a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Centered figure variant */
.guide-figure--center {
    text-align: center;
}

.guide-figure--center .guide-figure__image {
    margin: 0 auto;
    max-width: 80%;
}

/* Small figure variant */
.guide-figure--small .guide-figure__image {
    max-width: 400px;
    margin: 0 auto;
}

/* Side-by-side figures */
.guide-figures-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.guide-figures-row .guide-figure {
    margin: 0;
}

@media (max-width: 768px) {
    .guide-figure__caption {
        padding: 0.5rem 0.75rem;
    }
    
    .guide-figure__text {
        font-size: 0.875rem;
    }
    
    .guide-figure--center .guide-figure__image {
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .guide-toc {
        padding: 1rem;
    }
    
    .guide-box {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .guide-box__icon {
        font-size: 1.25rem;
    }
    
    .guide-content h1 {
        font-size: 1.75rem;
    }
    
    .guide-content h2 {
        font-size: 1.5rem;
    }
    
    .guide-content h3 {
        font-size: 1.25rem;
    }
    
    .guide-content table {
        font-size: 0.85rem;
    }
    
    .guide-content th,
    .guide-content td {
        padding: 0.625rem 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   Scroll-to-Heading Animation
   -------------------------------------------------------------------------- */
.guide-content h2:target,
.guide-content h3:target {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% {
        background: #fef3c7;
    }
    100% {
        background: transparent;
    }
}

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed header */
.guide-content h2,
.guide-content h3 {
    scroll-margin-top: 100px;
}

/* --------------------------------------------------------------------------
   Product Carousel (:::product[id]) - Horizontal Scroll
   -------------------------------------------------------------------------- */

/* Carousel-Container */
.product-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

/* Carousel Wrapper */
.product-carousel-wrapper {
    position: relative;
    margin: 1rem 0 1.5rem 0;
}

/* Fade-Effekt rechts als visueller Hinweis */
.product-carousel-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: calc(100% - 2rem);
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.95));
    pointer-events: none;
    z-index: 1;
}

/* Swipe-Hinweis */
.product-carousel__hint {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0.5rem 0;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.product-carousel__hint::before {
    content: "👆";
}

.product-carousel-wrapper.scrolled .product-carousel__hint {
    opacity: 0;
}

.product-carousel-wrapper.scrolled::after {
    opacity: 0;
}

/* Scrollbar styling */
.product-carousel::-webkit-scrollbar {
    height: 6px;
}

.product-carousel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.product-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.product-carousel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.product-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.875rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.product-card__image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 0.625rem;
}

.product-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__description {
    display: none; /* Versteckt im Carousel für kompaktere Darstellung */
}

.product-card__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.product-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff !important;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.product-card__button:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

@media (max-width: 640px) {
    .product-card {
        flex: 0 0 160px;
    }
    
    .product-card__image {
        height: 90px;
    }
    
    .product-card__title {
        font-size: 0.8rem;
    }
}
