/* GroovyGrails Tutorial Hub - Custom Styles */
:root {
    --green: #16a34a;
    --green-dark: #15803d;
}

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.chapter-card {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.chapter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}
.chapter-num {
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 50%;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.read-more-btn {
    white-space: nowrap;
}
.read-more-btn i {
    transition: transform 0.2s;
}
.chapter-card:hover .read-more-btn {
    background-color: var(--green);
    color: #fff;
    border-color: var(--green);
}
.chapter-card:hover .read-more-btn i {
    transform: translateX(3px);
}
.xsmall { font-size: 0.78rem; }
.ad-sample-box {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #f8fafc;
}
.ad-sample-box img {
    display: block;
}

/* Sidebar scroll */
.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Broadcrumb (Tailwind style) */
.breadcrumb-site a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}
.breadcrumb-site a:hover {
    color: var(--green);
    text-decoration: underline;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.65rem;
    line-height: 1;
    color: #d1d5db;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

.sidebar-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
    border-bottom: 1px solid rgba(22, 163, 74, 0.25);
    transition: background 0.15s ease;
}
.sidebar-banner:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.category-icon {
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: 10px;
}

/* Ad slots */
.ad-slot {
    border: 1px dashed #d0d5dc;
    background: #fbfcfd;
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    overflow: hidden;
}
.ad-label {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #adb5bd;
    margin-bottom: 0.5rem;
}
.ad-rail {
    position: sticky;
    top: 90px;
    z-index: 1;
}
.ad-slot-side {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.ad-slot-side .adsbygoogle {
    max-width: 300px;
    margin: 0 auto;
}

/* ---- Try-it-yourself live editor ---- */
.tryit-wrap {
    margin: 1rem 0 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tryit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
}
.tryit-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tryit-title .pulse {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: tryitPulse 1.6s ease-in-out infinite;
}
@keyframes tryitPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
    50% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
}
.tryit-body { display: flex; flex-direction: column; }
.tryit-editor textarea {
    width: 100%;
    min-height: 140px;
    border: 0;
    border-bottom: 1px solid #dee2e6;
    padding: 12px;
    font-family: "Consolas", "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: #f6f8fa;
    color: #24292f;
    resize: vertical;
    outline: none;
    tab-size: 4;
}
.tryit-result {
    display: none;
    width: 100%;
    min-height: 160px;
    border: 0;
    background: #fff;
}
.tryit-result.show { display: block; }
.tryit-open {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--green);
    border: 1px solid var(--green);
    background: #fff;
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all .15s;
}
.tryit-open:hover {
    background: var(--green);
    color: #fff;
}
.tryit-open .fa { margin-right: 4px; }
pre code { border-radius: 6px; }

/* ---- Tutorial content (rendered from DB) ---- */
.tutorial-content { font-size: 1rem; line-height: 1.8; color: #1f2937; }
.tutorial-content h1,
.tutorial-content h2,
.tutorial-content h3,
.tutorial-content h4 {
    font-weight: 700;
    color: #111827;
    margin-top: 1.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.tutorial-content h1 { font-size: 1.75rem; }
.tutorial-content h2 { font-size: 1.5rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.4rem; }
.tutorial-content h3 { font-size: 1.25rem; }
.tutorial-content h4 { font-size: 1.05rem; }
.tutorial-content p { margin: 0.9rem 0; }
.tutorial-content a { color: var(--green); text-decoration: underline; }
.tutorial-content ul, .tutorial-content ol { padding-left: 1.6rem; margin: 0.9rem 0; }
.tutorial-content ul { list-style: disc; }
.tutorial-content ol { list-style: decimal; }
.tutorial-content li { margin: 0.35rem 0; }
.tutorial-content blockquote {
    border-left: 4px solid var(--green);
    background: #f0fdf4;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: #374151;
}
.tutorial-content pre {
    margin: 1rem 0;
    border-radius: 8px;
    overflow-x: auto;
    background: #f6f8fa;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tutorial-content pre code {
    display: block;
    padding: 1rem;
    background: transparent;
    color: #24292f;
    font-family: "Consolas", "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    tab-size: 4;
}
.tutorial-content pre code:not(.hljs) {
    background: transparent !important;
    color: #24292f !important;
}
.tutorial-content p code,
.tutorial-content li code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #b91c1c;
}
.tutorial-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9em;
}
.tutorial-content th,
.tutorial-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.tutorial-content th {
    background: #f9fafb;
    font-weight: 600;
}
.tutorial-content img { max-width: 100%; border-radius: 8px; }
.tutorial-content hr { border-color: #e5e7eb; margin: 1.5rem 0; }