/* Global Styles */
:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --accent-color: #ef7c00;
    --text-color: #212529;
    --light-text: #f8f9fa;
    --dark-bg: #343a40;
    --lighter-bg: #495057;
    --lightest-bg: #e9ecef;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --success-color: #28a745;
    --card-hover: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: #0c1116;
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
}

body.overlay-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: var(--light-text);
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Container */
.blog-container {
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0c1116 0%, #202a36 100%);
    z-index: -1;
    opacity: 0.9;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(12, 17, 22, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress-container, 
#progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar, 
#myBar {
    height: 100%;
    width: 0;
    background-color: var(--accent-color);
    transition: width 0.1s ease;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    display: flex;
    align-items: center;
    justify-content: center;
    scale: 1.8;
    top: -4.5px;
    left: 3.5%
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    top: -4.5px;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--light-text);
    line-height: 1.2;
}

.location {
    font-size: 0.8rem;
    margin-left: 0;
    opacity: 0.7;
    line-height: 1.2;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
}

.main-nav ul li a {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    color: var(--light-text);
    transition: color 0.3s ease;
}

.main-nav ul li a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after {
    width: 100%;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.signup-btn {
    padding: 0.5rem 1.2rem;
    background-color: var(--accent-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.signup-btn:hover {
    background-color: #d96e00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Blog Content */
.blog-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 5% 2rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.category-label {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--accent-color);
    color: var(--light-text);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.blog-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.featured-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 8px;
}

.featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-image:hover {
    transform: scale(1.05);
}

.blog-description {
    background-color: rgba(33, 37, 41, 0.7);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Table of Contents */
.table-of-contents {
    background-color: rgba(33, 37, 41, 0.5);
    padding: 1.5rem 2rem;
    margin-bottom: 3rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.table-of-contents h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.table-of-contents ul {
    list-style: none;
    margin-left: 1rem;
}

.table-of-contents ul li a {
    display: block;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.table-of-contents ul li a:hover {
    color: var(--accent-color);
}

/* Blog Sections */
.blog-section {
    margin-bottom: 4rem;
}

.blog-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.section-content {
    font-size: 1.1rem;
    line-height: 1.7;
}

.section-content p {
    margin-bottom: 1.5rem;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* Author Bio */
.author-bio {
    display: flex;
    gap: 20px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 40px;
}

.author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.author-title {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.author-description {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Share Options */
.share-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: rgba(33, 37, 41, 0.5);
    border-radius: 8px;
}

.share-options p {
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.share-button.twitter:hover {
    background-color: #1DA1F2;
}

.share-button.facebook:hover {
    background-color: #4267B2;
}

.share-button.linkedin:hover {
    background-color: #0077B5;
}

.share-button.reddit:hover {
    background-color: #FF4500;
}

/* Related Posts */
.related-posts,
.you-might-like {
    margin-bottom: 4rem;
}

.related-posts h2,
.you-might-like h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.related-posts-grid,
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Post Card */
.post-card {
    display: block;
    background-color: rgba(33, 37, 41, 0.5);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.post-card-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 60%;
}

.post-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.1);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--accent-color);
    color: var(--light-text);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

.post-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--light-text);
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.post-card-link:hover {
    color: #d96e00;
}

/* Footer */
.site-footer {
    background-color: rgba(12, 17, 22, 0.9);
    padding: 4rem 5% 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.footer-logo {
    margin-bottom: 1rem;
    width: 250px;
}

.footer-logo .logo-text {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-logo p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    display: flex;
    gap: 4rem;
    justify-content: space-between;
    flex: 1;
    max-width: 800px;
}

.footer-column {
    flex: 1;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-column ul li a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-column ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Overlays */
.subscription-overlay,
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subscription-container,
.search-container {
    background-color: #1a2430;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.search-container {
    background-color: #111;
    border-radius: 10px;
    padding: 25px 30px;
    width: 90%;
    max-width: 800px;
    max-height: 84vh;
    position: relative;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
    overflow-y: auto;
}

.search-input-container {
    display: flex;
    margin-bottom: 1.2rem;
    position: relative;
}

.search-results h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.subscription-header,
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.subscription-header h2,
.search-header h2 {
    font-size: 1.5rem;
    color: var(--light-text);
}

.close-btn {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.subscription-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.subscription-form input {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.subscription-form button {
    padding: 0.8rem;
    background-color: var(--accent-color);
    color: var(--light-text);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.subscription-form button:hover:not(:disabled) {
    background-color: #d96e00;
}

.subscription-form button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.search-input-container input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px 0 0 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    font-size: 1rem;
}

.search-input-container button {
    padding: 0.8rem 1.2rem;
    background-color: var(--accent-color);
    color: var(--light-text);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input-container button:hover {
    background-color: #d96e00;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.search-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.search-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.search-card-img {
    height: 120px;
    overflow: hidden;
}

.search-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.search-card-content {
    padding: 10px;
    flex-grow: 1;
}

.search-card-category {
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.search-card-title {
    color: white;
    font-size: 15px;
    margin-bottom: 6px;
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-style: italic;
}

.search-random-posts {
    margin-top: 2rem;
}

.search-random-posts h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.search-random-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .related-posts-grid,
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-random-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        margin-bottom: 0.5rem;
    }
    
    .main-nav {
        margin: 0.5rem 0;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 2rem;
        margin-top: 2rem;
    }

    .search-overlay {
        padding: 0 10px;
        align-items: flex-start;
    }

    .search-container {
        margin-top: 60px;
        padding: 15px;
        width: 100%;
        max-height: 85vh;
        overflow-y: auto;
    }

    .search-header {
        margin-bottom: 15px;
    }

    .search-header h2 {
        font-size: 20px;
    }

    .search-input-container {
        margin-bottom: 15px;
    }

    .search-input-container input {
        font-size: 14px;
        padding: 10px;
    }

    .search-input-container button {
        padding: 10px 15px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .main-nav ul {
        gap: 1rem;
    }
    
    .related-posts-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-description {
        font-size: 1rem;
    }
    
    .blog-section h2 {
        font-size: 1.5rem;
    }
    
    .subscription-form {
        flex-direction: column;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
    }
    .search-random-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-container {
        margin-top: 50px;
        padding: 12px;
    }

    .search-header h2 {
        font-size: 18px;
    }

    .search-input-container input {
        font-size: 13px;
        padding: 8px;
    }

    .search-input-container button {
        padding: 8px 12px;
    }

    .search-card-title {
        font-size: 14px;
    }
}

/* Animation classes */
.overlay-visible {
    display: flex;
    opacity: 1;
}

.container-visible {
    transform: translateY(0);
}

/* Add smooth scrolling for table of contents */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Active state for navigation */
.main-nav ul li.active a::after {
    width: 100%;
}

.main-nav ul li.active a {
    color: var(--accent-color);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay.active .search-container {
    transform: translateY(0);
    opacity: 1;
}

.overlay-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.container-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
}