/* Single Post Enhanced Styles */

/* Post Header Dynamic Background */
.post-dynamic-header {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.post-dynamic-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(67, 97, 238, 0.85) 0%,
        rgba(63, 55, 201, 0.85) 50%,
        rgba(72, 149, 239, 0.85) 100%
    );
    z-index: 1;
}

.post-dynamic-header .header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.post-header-meta {
    margin-bottom: 20px;
}

.post-header-category {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--white);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.post-header-category:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: var(--white);
    text-decoration: none;
}

.post-header-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 25px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.post-header-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
}

.post-header-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.post-header-author:hover img {
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.post-header-author span {
    text-align: left;
}

.post-header-author strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 3px;
    font-weight: 700;
}

.post-header-author time {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Enhanced Post Content */
.single-post-container {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    min-height: 100vh;
}

.single-post-container .blog-main-content {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    padding: 50px;
    margin-top: -30px;
    position: relative;
    z-index: 3;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.post-full-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 50px;
    font-family: 'Tajawal', Georgia, serif;
}

.post-full-content h1,
.post-full-content h2,
.post-full-content h3,
.post-full-content h4,
.post-full-content h5,
.post-full-content h6 {
    color: var(--dark-color);
    margin: 40px 0 20px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
}

.post-full-content h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.post-full-content h2 {
    font-size: 2rem;
    position: relative;
    padding-right: 20px;
}

.post-full-content h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.post-full-content h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.post-full-content h4 {
    font-size: 1.4rem;
}

.post-full-content p {
    margin-bottom: 25px;
    text-align: justify;
}

.post-full-content img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
    transition: all 0.3s ease;
}

.post-full-content img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.post-full-content blockquote {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-right: 5px solid var(--primary-color);
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 15px;
    font-style: italic;
    font-size: 1.1rem;
    position: relative;
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.1);
}

.post-full-content blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.post-full-content ul,
.post-full-content ol {
    margin: 20px 0;
    padding-right: 25px;
}

.post-full-content li {
    margin-bottom: 12px;
    position: relative;
}

.post-full-content ul li::before {
    content: '';
    position: absolute;
    right: -20px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

.post-full-content ol li {
    counter-increment: list-counter;
}

.post-full-content ol {
    counter-reset: list-counter;
}

.post-full-content ol li::before {
    content: counter(list-counter);
    position: absolute;
    right: -25px;
    top: 0;
    background: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.post-full-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-full-content a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-color);
}

.post-full-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
}

.post-full-content pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.post-full-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Enhanced Post Footer */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-top: 2px solid var(--border-color);
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 25px;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 15px;
    padding: 30px;
    margin: 40px -20px;
}

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

.post-tags .tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    color: var(--text-color);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(67, 97, 238, 0.2);
    position: relative;
    overflow: hidden;
}

.post-tags .tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: all 0.3s ease;
    z-index: -1;
}

.post-tags .tag:hover::before {
    left: 0;
}

.post-tags .tag:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.social-sharing {
    display: flex;
    align-items: center;
    gap: 20px;
}

.share-text {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: 50%;
    transform: scale(0);
    transition: all 0.3s ease;
}

.social-icon:hover::before {
    transform: scale(1.2);
}

.social-icon i {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
}

.social-icon.facebook {
    background: linear-gradient(135deg, #3b5998, #4c70ba);
}

.social-icon.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.social-icon.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
}

.social-icon.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Enhanced Author Box */
.author-box {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 20px;
    padding: 35px;
    display: flex;
    gap: 25px;
    align-items: center;
    border: 2px solid rgba(67, 97, 238, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.author-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(72, 149, 239, 0.05));
    transition: all 0.5s ease;
}

.author-box:hover::before {
    left: 0;
}

.author-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(67, 97, 238, 0.15);
    border-color: rgba(67, 97, 238, 0.3);
}

.author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.author-box:hover .author-avatar {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.author-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.author-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.author-box:hover .author-name {
    color: var(--primary-color);
}

.author-bio {
    color: var(--light-text);
    line-height: 1.7;
    font-size: 1rem;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(67, 97, 238, 0.1);
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.1s ease;
}

/* Table of Contents */
.table-of-contents {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    border: 2px solid rgba(67, 97, 238, 0.1);
}

.table-of-contents h4 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 0;
    display: block;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.table-of-contents a:hover {
    color: var(--primary-color);
    padding-right: 10px;
    border-bottom-color: var(--primary-color);
}

/* Responsive Design for Single Post */
@media (max-width: 1024px) {
    .post-dynamic-header {
        height: 400px;
    }
    
    .post-header-title {
        font-size: 2.5rem;
    }
    
    .single-post-container .blog-main-content {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .post-dynamic-header {
        height: 350px;
        background-attachment: scroll;
    }
    
    .post-header-title {
        font-size: 2rem;
    }
    
    .single-post-container .blog-main-content {
        padding: 30px;
        border-radius: 15px 15px 0 0;
    }
    
    .post-full-content {
        font-size: 1.1rem;
        padding: 0;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin: 30px -15px;
        padding: 25px;
    }
    
    .social-sharing {
        width: 100%;
        justify-content: center;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .post-dynamic-header {
        height: 300px;
    }
    
    .post-header-title {
        font-size: 1.6rem;
    }
    
    .single-post-container .blog-main-content {
        padding: 20px;
    }
    
    .post-full-content {
        font-size: 1rem;
    }
    
    .post-full-content h1 {
        font-size: 1.8rem;
    }
    
    .post-full-content h2 {
        font-size: 1.5rem;
    }
    
    .social-icons {
        gap: 8px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
}

/* Print Styles for Single Post */
@media print {
    .post-dynamic-header,
    .post-footer,
    .author-box,
    .reading-progress {
        display: none;
    }
    
    .single-post-container .blog-main-content {
        padding: 0;
        box-shadow: none;
        border: none;
        margin-top: 0;
    }
    
    .post-full-content {
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
    }
    
    .post-full-content h1,
    .post-full-content h2,
    .post-full-content h3 {
        color: #000;
        page-break-after: avoid;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .post-full-content {
        color: #e0e0e0;
    }
    
    .post-full-content h1,
    .post-full-content h2,
    .post-full-content h3,
    .post-full-content h4,
    .post-full-content h5,
    .post-full-content h6 {
        color: #ffffff;
    }
    
    .post-full-content blockquote {
        background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
        color: #e0e0e0;
    }
    
    .author-box {
        background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
        border-color: rgba(67, 97, 238, 0.3);
    }
    
    .author-name {
        color: #ffffff;
    }
    
    .author-bio {
        color: #b0b0b0;
    }
}