/* ===========================================
   FSTECH BLOG - CSS PÁGINA DE POST INDIVIDUAL
   MVP (Minimum Viable Product)
   Data: 13/09/2025
   =========================================== */

/* ===========================================
   BARRA DE PROGRESSO DE LEITURA
   =========================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 9999;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-500), var(--accent-cyan));
    width: 0%;
    transition: width 0.3s ease;
}

/* ===========================================
   HERO DO POST
   =========================================== */

.post-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.post-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(20, 107, 255, 0.3) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 2;
}

.post-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    width: 100%;
}

.post-hero .post-categories {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.post-hero .post-category {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.post-hero .post-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin: var(--spacing-lg) auto;
    max-width: 800px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.post-meta-item i {
    color: var(--accent-400);
}

/* ===========================================
   LAYOUT DO POST
   =========================================== */

.post-content-section {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-primary);
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-3xl);
    align-items: start;
}

.post-main-content {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: var(--spacing-3xl);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.post-sidebar {
    position: sticky;
    top: var(--spacing-xl);
    height: fit-content;
}

/* ===========================================
   CONTEÚDO DO POST
   =========================================== */

.post-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: white;
    font-weight: 600;
    margin: var(--spacing-2xl) 0 var(--spacing-lg);
    position: relative;
}

.post-content h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--accent-500);
    padding-bottom: var(--spacing-md);
}

.post-content h2 {
    font-size: 2rem;
    color: var(--accent-400);
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

.post-content p {
    margin: var(--spacing-lg) 0;
    text-align: justify;
}

.post-content a {
    color: var(--accent-400);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--accent-cyan);
}

.post-content ul,
.post-content ol {
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-xl);
}

.post-content li {
    margin: var(--spacing-sm) 0;
    line-height: 1.6;
}

.post-content ul li::marker {
    color: var(--accent-400);
}

.post-content ol li::marker {
    color: var(--accent-400);
    font-weight: 600;
}

.post-content blockquote {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: rgba(20, 107, 255, 0.1);
    border-left: 4px solid var(--accent-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
}

.post-content blockquote p {
    margin: 0;
}

.post-content code {
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-cyan);
}

.post-content pre {
    background: rgba(0, 0, 0, 0.8);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--spacing-xl) 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-xl) auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-xl) 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-content th,
.post-content td {
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.post-content th {
    background: rgba(20, 107, 255, 0.2);
    font-weight: 600;
    color: white;
}

.post-content td {
    color: rgba(255, 255, 255, 0.8);
}

/* ===========================================
   TAGS E COMPARTILHAMENTO
   =========================================== */

.post-tags-section,
.post-share-section {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-tags-section h3,
.post-share-section h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    color: white;
    font-weight: 600;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.post-tag {
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(20, 107, 255, 0.2);
    color: var(--accent-400);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(20, 107, 255, 0.3);
}

.post-tag:hover {
    background: rgba(20, 107, 255, 0.3);
    transform: translateY(-2px);
}

.post-share-section .post-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.post-share-section .share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.post-share-section .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.post-share-section .share-twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.post-share-section .share-linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.post-share-section .share-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.post-share-section .share-copy:hover {
    background: var(--accent-500);
    border-color: var(--accent-500);
}

/* ===========================================
   NAVEGAÇÃO DO POST
   =========================================== */

.post-navigation {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--accent-500), var(--accent-cyan));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-blog:hover {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-500));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 107, 255, 0.3);
}

/* ===========================================
   SIDEBAR WIDGETS
   =========================================== */

.post-sidebar .sidebar-widget {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
}

.toc-widget {
    position: sticky;
    top: calc(var(--spacing-xl) + 60px);
}

.table-of-contents {
    max-height: 400px;
    overflow-y: auto;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin: var(--spacing-sm) 0;
}

.table-of-contents a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.table-of-contents a:hover,
.table-of-contents a.active {
    background: rgba(20, 107, 255, 0.2);
    color: var(--accent-400);
    transform: translateX(5px);
}

.table-of-contents .toc-h2 {
    padding-left: var(--spacing-md);
}

.table-of-contents .toc-h3 {
    padding-left: var(--spacing-lg);
    font-size: 0.8rem;
}

.table-of-contents .toc-h4 {
    padding-left: var(--spacing-xl);
    font-size: 0.75rem;
}

/* Custom scrollbar for TOC */
.table-of-contents::-webkit-scrollbar {
    width: 4px;
}

.table-of-contents::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.table-of-contents::-webkit-scrollbar-thumb {
    background: var(--accent-500);
    border-radius: 2px;
}

/* ===========================================
   POSTS RELACIONADOS
   =========================================== */

.related-posts-section {
    padding: var(--spacing-3xl) 0;
    background: rgba(5, 5, 5, 0.8);
}

.related-posts-section .section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: white;
    justify-content: center;
}

.related-posts-section .section-title i {
    color: var(--accent-500);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.related-post-card {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(20, 107, 255, 0.2);
    border-color: rgba(20, 107, 255, 0.3);
}

.related-post-image {
    height: 180px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: var(--spacing-lg);
}

.related-post-categories {
    font-size: 0.75rem;
    color: var(--accent-400);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.5px;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.related-post-title a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a:hover {
    color: var(--accent-500);
}

.related-post-excerpt {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-date {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ===========================================
   RESPONSIVIDADE
   =========================================== */

@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .post-sidebar {
        position: static;
        order: -1;
    }

    .toc-widget {
        position: static;
    }

    .table-of-contents {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .post-hero {
        min-height: 50vh;
    }

    .post-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .post-meta {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }

    .post-main-content {
        padding: var(--spacing-xl);
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h1 {
        font-size: 2rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-share-section .post-share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .post-hero-content {
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    .post-main-content {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-sm);
    }

    .post-content pre {
        margin-left: -var(--spacing-lg);
        margin-right: -var(--spacing-lg);
        border-radius: 0;
    }

    .post-content table {
        font-size: 0.875rem;
    }

    .post-share-section .post-share-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   ANIMAÇÕES E EFEITOS
   =========================================== */

.post-main-content,
.related-post-card,
.sidebar-widget {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.post-main-content {
    animation-delay: 0.1s;
}

.sidebar-widget:nth-child(1) { animation-delay: 0.2s; }
.sidebar-widget:nth-child(2) { animation-delay: 0.3s; }
.sidebar-widget:nth-child(3) { animation-delay: 0.4s; }

.related-post-card:nth-child(1) { animation-delay: 0.1s; }
.related-post-card:nth-child(2) { animation-delay: 0.2s; }
.related-post-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   ESTADOS DE LOADING
   =========================================== */

.post-loading {
    opacity: 0.6;
    pointer-events: none;
}

.post-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
    .reading-progress,
    .post-hero-image,
    .post-sidebar,
    .post-share-section,
    .related-posts-section,
    .tech-footer {
        display: none !important;
    }

    .post-main-content {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
    }

    .post-content,
    .post-content h1,
    .post-content h2,
    .post-content h3,
    .post-content h4,
    .post-content h5,
    .post-content h6 {
        color: black !important;
    }

    .post-layout {
        grid-template-columns: 1fr !important;
    }
}
