/* ===================================
   VIEW PAGE - COMPLETE STYLES
   =================================== */

/* Main Container */
.view-post {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.view-post.loaded {
    opacity: 1;
}

/* Reveal Animation */
.reveal-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   BANNER / HERO SECTION
   =================================== */
.post-banner {
    position: relative;
    width: 100%;
    height: 420px;
    background-color: var(--bg-tertiary);
    background-size: cover;
    background-position: center;
    border-radius: 0 0 32px 32px;
    overflow: hidden;
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: 0 16px 48px var(--card-shadow);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.406) 0%,
        rgba(15, 23, 42, 0.607) 40%,
        rgba(15, 23, 42, 0.2) 70%,
        transparent 100%
    );
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 40px 24px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ===================================
   POST HEADER (inside banner)
   =================================== */
.post-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.post-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 28px;
    overflow: hidden;
}

.icon {
    display: inline-block;
    width: 128px;
    height: 128px;
    background-repeat: no-repeat;
    background-size: auto;
}

.post-icon .icon {
    flex-shrink: 0;
    transform-origin: center;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    padding: 5px 14px;
    background: var(--card-bg);
    backdrop-filter: blur(6px);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    letter-spacing: 0.3px;
}

#post-title {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 800;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    flex-wrap: wrap;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.meta-item {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.like-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    outline: none;
}

.like-btn i {
    font-size: 16px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.like-btn.active i {
    color: #ef4444;
}

.like-btn:hover i {
    transform: scale(1.2);
}

.like-btn.pop {
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ===================================
   MAIN LAYOUT (Content + Sidebar)
   =================================== */
.post-main-layout {
    display: flex;
    gap: 48px;
    max-width: 1200px;
    margin: 40px auto 60px auto;
    padding: 0 24px;
    align-items: flex-start;
}

.post-content-area {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.post-body-container {
    padding: 0;
    margin-bottom: 48px;
}

/* ===================================
   DESCRIPTION
   =================================== */
.post-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0 0 48px 0;
    font-weight: 400;
    letter-spacing: 0.1px;
    white-space: pre-wrap;
}

/* ===================================
   DYNAMIC SECTION CARDS
   =================================== */
.post-sections {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 48px;
    width: 100%;
    max-width: 100%;
}

.post-section-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Clearfix — ensures card stretches around floated image */
.post-section-card::after {
    content: "";
    display: table;
    clear: both;
}

.post-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.section-image-wrapper {
    float: left;
    width: 40%;
    margin: 4px 24px 16px 0;
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
}

.section-image-wrapper img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    transition: transform 0.5s ease;
}

.post-section-card:hover .section-image-wrapper img {
    transform: scale(1.03);
}

/* No overflow:hidden — lets text flow under image naturally */
.section-content {
    display: block;
}

.step-badge {
    display: none;
    align-items: center;
    padding: 5px 14px;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 8px;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.section-text {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: pre-wrap;
}


/* ===================================
   TUTORIAL SECTION
   =================================== */

.post-tutorial {
    flex: 1;
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-wrap;
    min-width: 0;
    color: var(--text-secondary);
}

.post-tutorial-link {
    margin-bottom: 24px;
}

.tutorial-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 16px 20px;
    border-radius: 12px;
    color: var(--text-primary);
}

.tutorial-banner i {
    font-size: 24px;
    color: #38bdf8;
}

.tutorial-banner span {
    font-weight: 600;
    font-size: 14px;
}

.tutorial-banner a {
    color: #38bdf8;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    font-weight: 500;
}

.tutorial-banner a:hover {
    text-decoration: underline;
}

.post-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.post-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--card-shadow);
}

.post-socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--img-container-bg);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-btn:hover {
    transform: translateY(-3px);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn.youtube:hover { background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.social-btn.instagram:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3); }
.social-btn.tiktok:hover { background: #000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.social-btn.facebook:hover { background: #1877f2; box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3); }

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0f1010, #00000045);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.download-timer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #1e293b;
    color: #94a3b8;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    cursor: not-allowed;
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

.download-timer-btn i {
    color: #38bdf8;
}

/* ===================================
   COMMENTS SECTION
   =================================== */
.comments-container {
    max-width: 900px;
    margin: 0 auto 60px auto;
    padding: 0 24px;
}

.comments-section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 16px var(--card-shadow);
}

.comments-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-form input,
.comment-form textarea {
    background: var(--img-container-bg);
    border: 1px solid var(--card-border);
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #38bdf8;
    outline: none;
}

.comment-form button {
    background: linear-gradient(135deg, #2b2c2bf0, #0000003c);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.344);
}

.comment-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.load-more-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: transparent;
    color: #38bdf8;
    border: 1px dashed rgba(56, 189, 248, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: #38bdf8;
}

.comment-item {
    background: var(--img-container-bg);
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid var(--card-border);
    line-height: 1.5;
    color: var(--text-secondary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.comment-name {
    font-weight: 700;
    color: #38bdf8;
}

/* ===================================
   LEGACY GALLERY (kept for compat)
   =================================== */
.post-gallery {
    margin-top: 0;
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 10px 0;
    scrollbar-width: none;
    width: 100%;
}

.post-gallery img {
    height: 300px;
    width: auto;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid rgba(26, 23, 23, 0.667);
    object-fit: cover;
    transition: transform .25s;
}

.post-gallery img:hover {
    transform: scale(1.04);
}

.gallery-container {
    position: relative;
    margin-top: 35px;
    display: flex;
    align-items: center;
}

.post-gallery::-webkit-scrollbar {
    display: none;
}

.gallery-btn {
    position: absolute;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

#gallery-prev { left: -20px; }
#gallery-next { right: -20px; }

.gallery-container.loading .post-gallery,
.gallery-container.loading .gallery-btn {
    display: none;
}

.gallery-container.loading::after {
    content: '';
    display: block;
    width: 100%;
    height: 322px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    50% { background: rgba(255, 255, 255, 0.1); }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1100px) {
    .post-main-layout {
        flex-direction: column;
        gap: 32px;
    }

    .post-sidebar {
        width: 100%;
        position: static;
    }

    .post-body-container {
        padding: 0;
    }
}

@media (max-width: 900px) {
    .view-post {
        margin-bottom: 40px;
        overflow-x: hidden;
    }

    .post-banner {
        height: 320px;
        border-radius: 0 0 24px 24px;
    }

    .banner-content {
        padding: 24px;
    }

    #post-title {
        font-size: 1.6rem;
    }

    .post-section-card {
        padding: 20px;
        border-radius: 16px;
    }

    .section-image-wrapper {
        float: none;
        width: 100%;
        margin: 0 0 16px 0;
    }
}

@media (max-width: 480px) {
    .post-banner {
        height: 280px;
        border-radius: 0 0 16px 16px;
    }

    .banner-content {
        padding: 16px;
    }

    #post-title {
        font-size: 1.4rem;
    }

    .post-meta {
        gap: 10px;
        font-size: 12px;
    }

    .post-description {
        font-size: 1rem;
    }

    .post-section-card {
        padding: 12px;
        border-radius: 14px;
    }

    .step-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .section-text {
        font-size: 0.95rem;
    }
}

/* ===================================
   PREMIUM CODE BLOCKS
   =================================== */
.code-block-wrapper {
    margin: 18px 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.8px;
}

.code-lang-info i {
    font-size: 13px;
    color: #38bdf8;
}

.copy-icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.copy-icon-btn:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.copy-icon-btn.copied {
    color: #22c55e;
}

.code-block-wrapper pre {
    margin: 0 !important;
    padding: 6px 12px !important;
    background: transparent !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    white-space: pre-wrap !important;
    overflow-x: auto;
    border-radius: 0;
}

.code-block-wrapper code {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: inline-block;
    width: 100%;
}

/* Customizing Prism.js appearance */
code[class*="language-"],
pre[class*="language-"] {
    text-shadow: none !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

/* Force Green Color for checkmark */
.copy-icon-btn.copied {
    color: #22c55e !important;
}

/* Fix for Prism's default styling that might add height */
pre[class*="language-"] {
    position: static !important;
}

/* Tutorial Banner Styles */
.post-tutorial-link {
    margin: 30px 0;
    width: 100%;
}

.tutorial-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(29, 78, 216, 0.05));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.tutorial-banner i {
    font-size: 32px;
    color: #2563eb;
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.3));
}

.tutorial-banner span {
    font-weight: 600;
    color: var(--text-color);
}

.tutorial-banner a {
    color: #2563eb !important;
    text-decoration: none;
    word-break: break-all;
    font-size: 14px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.tutorial-banner a:hover {
    border-color: #2563eb;
}

/* Hide reCAPTCHA badge */
.grecaptcha-badge {
    visibility: hidden;
}
