/* ================================================================
   tutorial-pages.css
   Shared styles for all individual tutorial pages.
   Class prefix: tut-  (e.g. .tut-hero, .tut-section, .tut-toc)
   ================================================================ */

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes float2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-2deg); }
}
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== READING PROGRESS BAR ========== */
.tut-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ec4899, #667eea);
    background-size: 300% 100%;
    animation: gradient-shift 3s ease infinite;
    z-index: 9999;
    transition: width 0.15s ease-out;
    border-radius: 0 2px 2px 0;
}

/* ========== HERO ========== */
.tut-hero {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 40%, #1a1a3e 70%, #0f0c29 100%);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}
.tut-hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -20%;
    width: 140%; height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(102, 126, 234, 0.18) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 30%, rgba(118, 75, 162, 0.12) 0%, transparent 40%);
    pointer-events: none;
}
.tut-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 150px;
    background: linear-gradient(to top, #f8fafc, transparent);
    pointer-events: none;
    z-index: 1;
}
.tut-floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    pointer-events: none;
}
.tut-floating-shape-1 {
    width: 300px; height: 300px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -80px; right: -60px;
    animation: float 8s ease-in-out infinite;
}
.tut-floating-shape-2 {
    width: 200px; height: 200px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    bottom: 40px; left: -40px;
    animation: float2 10s ease-in-out infinite;
}
.tut-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}
.tut-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 10px 20px;
    border-radius: 50px;
    color: #a5b4fc;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}
.tut-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 6px 14px;
    border-radius: 50px;
    color: #6ee7b7;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 10px;
}
.tut-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}
.tut-hero-meta i { color: rgba(255, 255, 255, 0.4); }
.tut-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}
.tut-hero h1 .tut-gradient-text {
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tut-hero .lead {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========== TOC ========== */
.tut-toc {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px 40px;
    margin: -50px auto 40px;
    max-width: 800px;
    position: relative;
    z-index: 3;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(226, 232, 240, 0.6);
}
.tut-toc h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}
.tut-toc ol {
    padding-left: 0;
    margin-bottom: 0;
    counter-reset: toc-counter;
    list-style: none;
}
.tut-toc ol li {
    padding: 8px 12px;
    counter-increment: toc-counter;
    border-radius: 10px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tut-toc ol li::before {
    content: counter(toc-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: #667eea;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.tut-toc ol li:hover {
    background: rgba(102, 126, 234, 0.06);
}
.tut-toc ol li a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.tut-toc ol li:hover a { color: #667eea; }

/* ========== CONTENT AREA ========== */
.tut-content {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 8%, #f0f0ff 18%, #eef6ff 32%, #f3f0ff 48%, #eef6ff 62%, #f0f0ff 78%, #f5f3ff 90%, #f0edff 100%);
    padding: 40px 0 60px;
    position: relative;
    overflow: hidden;
}
.tut-content::before {
    content: '';
    position: absolute;
    top: 5%; left: -15%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

/* ========== SECTIONS ========== */
.tut-section {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.tut-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.tut-section:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.07);
}
.tut-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.tut-section:hover::before { opacity: 1; }
.tut-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tut-section h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.tut-section:hover h2::after { width: 120px; }
.tut-section h2 .tut-icon-box {
    font-size: 1.4rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
    width: 44px; height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #667eea;
    flex-shrink: 0;
}
.tut-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #334155;
    margin-top: 32px;
    margin-bottom: 14px;
    padding-left: 14px;
    border-left: 3px solid rgba(102, 126, 234, 0.3);
}
.tut-section p, .tut-section li {
    color: #64748b;
    line-height: 1.8;
    font-size: 0.97rem;
}
.tut-section a { color: #667eea; }

/* ========== INFO & WARNING BOXES ========== */
.tut-info-box {
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.7;
}
.tut-info-box i { color: #667eea; }
.tut-warning-box {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.7;
}
.tut-warning-box i { color: #f59e0b; }
.tut-success-box {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    color: #065f46;
    font-size: 0.9rem;
    line-height: 1.7;
}
.tut-success-box i { color: #10b981; }

/* ========== STEP CARDS ========== */
.tut-step-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
}
.tut-step-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.3);
}
.tut-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ========== SCREENSHOT ========== */
.tut-screenshot {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin: 20px 0;
}

/* ========== FEATURE GRID ========== */
.tut-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.tut-feature-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.25s ease;
}
.tut-feature-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}
.tut-feature-card .tut-feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}
.tut-feature-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}
.tut-feature-card p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ========== COMPARISON TABLE ========== */
.tut-compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
}
.tut-compare-table thead th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    padding: 12px 16px;
    font-weight: 700;
    color: #334155;
    font-size: 0.9rem;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.tut-compare-table tbody td {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #64748b;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}
.tut-compare-table tbody tr:last-child td { border-bottom: none; }
.tut-compare-table tbody tr:hover { background: rgba(102, 126, 234, 0.03); }
.tut-compare-table code {
    background: rgba(102, 126, 234, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #667eea;
}
.tut-compare-table .tut-recommended {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ========== VARIABLE TAG ========== */
.tut-var-tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 600;
}

/* ========== CODE BLOCKS ========== */
.tut-code {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 16px 0;
    overflow-x: auto;
    position: relative;
}
.tut-code pre {
    margin: 0;
    color: #e2e8f0;
    white-space: pre;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}
.tut-code .copy-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.tut-code .copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.tut-code-label {
    display: inline-block;
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
    padding: 2px 10px;
    border-radius: 6px 6px 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: -1px;
}

/* ========== CTA ========== */
.tut-cta {
    background: linear-gradient(135deg, #0f0c29, #302b63, #1a1a3e);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    color: #fff;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}
.tut-cta h2 { color: #fff; font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.tut-cta p { color: rgba(255,255,255,0.7); font-size: 1.1rem; margin-bottom: 24px; }
.tut-cta .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    padding: 14px 32px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
}

/* ========== FAQ ACCORDION ========== */
.tut-faq-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.tut-faq-item:hover {
    border-color: rgba(102, 126, 234, 0.3);
}
.tut-faq-question {
    padding: 16px 20px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tut-faq-question i {
    color: #667eea;
    transition: transform 0.3s ease;
}
.tut-faq-item.active .tut-faq-question i {
    transform: rotate(90deg);
}
.tut-faq-answer {
    padding: 0 20px 16px;
    color: #64748b;
    font-size: 0.93rem;
    line-height: 1.7;
    display: none;
}
.tut-faq-item.active .tut-faq-answer {
    display: block;
}

/* ========== DARK MODE ========== */
body.dark-mode .tut-toc,
body.dark-mode .tut-section,
body.dark-mode .tut-step-card,
body.dark-mode .tut-feature-card,
body.dark-mode .tut-faq-item {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255,255,255,0.08);
    color: #e2e8f0;
}
body.dark-mode .tut-toc h2,
body.dark-mode .tut-section h2 { color: #f1f5f9; }
body.dark-mode .tut-section h3 { color: #cbd5e1; }
body.dark-mode .tut-section p,
body.dark-mode .tut-section li { color: #94a3b8; }
body.dark-mode .tut-toc ol li a { color: #94a3b8; }
body.dark-mode .tut-toc ol li:hover a { color: #a5b4fc; }
body.dark-mode .tut-content {
    background: linear-gradient(180deg, #0f172a, #1e1b4b, #0f172a);
}
body.dark-mode .tut-feature-card h4 { color: #f1f5f9; }
body.dark-mode .tut-feature-card p { color: #94a3b8; }
body.dark-mode .tut-info-box { color: #cbd5e1; }
body.dark-mode .tut-warning-box { color: #fcd34d; background: rgba(245, 158, 11, 0.1); }
body.dark-mode .tut-success-box { color: #6ee7b7; background: rgba(16, 185, 129, 0.1); }
body.dark-mode .tut-screenshot { border-color: rgba(255,255,255,0.1); }
body.dark-mode .tut-compare-table { border-color: rgba(255,255,255,0.1); }
body.dark-mode .tut-compare-table thead th { background: rgba(30, 41, 59, 0.6); color: #e2e8f0; border-color: rgba(255,255,255,0.1); }
body.dark-mode .tut-compare-table tbody td { color: #94a3b8; border-color: rgba(255,255,255,0.05); }
body.dark-mode .tut-compare-table code { background: rgba(102, 126, 234, 0.15); color: #a5b4fc; }
body.dark-mode .tut-faq-question { color: #f1f5f9; }
body.dark-mode .tut-faq-answer { color: #94a3b8; }
body.dark-mode .tut-var-tag { background: rgba(102, 126, 234, 0.2); border-color: rgba(102, 126, 234, 0.3); color: #a5b4fc; }
body.dark-mode .tut-code { background: #0f172a; border: 1px solid rgba(255,255,255,0.08); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .tut-hero h1 { font-size: 2rem; }
    .tut-section { padding: 24px; }
    .tut-toc { padding: 20px; margin: -30px 16px 24px; }
    .tut-feature-grid { grid-template-columns: 1fr; }
    .tut-hero-meta { flex-direction: column; gap: 8px; }
    .tut-code { padding: 14px 16px; }
}
