/**
 * Custom fixes for CODEBIT website
 * Comprehensive styling including blog, product, and general layout improvements
 */

/* ======================================================
   GENERAL FIXES
   ====================================================== */

/* Adjust spacing for feature lists */
.features-list {
    margin-top: 16px;
}

.features-list li {
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

/* Reduce spacing between feature items */
.feature-item {
    margin-bottom: 16px !important;
}

/* Compact product features list */
.product-features {
    margin: 8px 0 !important;
}

.product-features li {
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

/* iOS style app icons */
img.product-icon {
    border-radius: 22.5% !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
    width: 180px !important;
    height: 180px !important;
    object-fit: cover !important;
}

/* Target product page icons as well */
.product-info .product-icon {
    width: 180px !important;
    height: 180px !important;
}

/* Target product card icons */
.product-card img.product-icon {
    width: 100px !important;
    height: 100px !important;
}

/* Also target any other potential icon structures */
.product-icon img {
    border-radius: 22.5% !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
}

.product-media img {
    border-radius: 22.5% !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
}

/* Remove gray background ONLY from product detail page icons */
.product-detail .product-icon {
    background-color: transparent !important;
    padding: var(--spacing-md) 0 !important;
}

/* ======================================================
   PRODUCT NAVIGATION STYLES
   ====================================================== */

/* Modern product navigation styles */
.product-nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 9999px;
    background-color: var(--background-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.product-nav-links li {
    margin: 0;
}

.product-nav-links a {
    display: block;
    padding: 8px 16px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-nav-links a:hover {
    background-color: rgba(var(--primary-color-rgb, 0, 113, 227), 0.05);
    color: var(--primary-color);
}

.product-nav-links a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Responsive navigation for smaller screens */
@media (max-width: 768px) {
    .product-nav-links {
        flex-direction: column;
        width: 100%;
        border-radius: 8px;
    }

    .product-nav-links li {
        width: 100%;
    }

    .product-nav-links a {
        text-align: center;
        padding: 12px 16px;
    }
}

/* ======================================================
   SUPPORT PAGE FIXES
   ====================================================== */

/* Center the support cards and increase width */
.support-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 24px !important;
}

.support-card {
    flex: 0 0 calc(33.333% - 24px) !important;
    min-width: 280px !important;
    max-width: 350px !important;
}

/* Fix email icon alignment with text */
.contact-method {
    display: flex !important;
    align-items: flex-start !important;
}

.method-icon {
    margin-right: 16px !important;
    flex-shrink: 0 !important;
    margin-top: 3px !important;
}

.method-details {
    display: flex !important;
    flex-direction: column !important;
}

.method-details h3,
.method-details p {
    margin: 0 !important;
}

.method-details h3 {
    margin-bottom: 4px !important;
}

/* ======================================================
   FAQ SECTION FIXES
   ====================================================== */

/* Fix FAQ toggle functionality */
.faq-question {
    cursor: pointer !important;
}

.faq-answer {
    display: none;
    padding: 16px 0;
}

.faq-item.active .faq-answer {
    display: block !important;
}

.toggle-icon {
    transition: transform 0.3s ease !important;
}

.faq-item.active .toggle-icon {
    transform: rotate(45deg) !important;
}

/* ======================================================
   BLOG LIST PAGE FIXES
   ====================================================== */

/* Blog list page styling */
.blog-post {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.blog-posts article {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.blog-posts article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Post meta information */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.post-category {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: var(--border-radius-pill);
    background-color: var(--primary-color);
    color: white;
    text-transform: uppercase;
    font-weight: var(--font-weight-medium);
}

.post-author {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.post-title {
    margin-bottom: var(--spacing-sm);
}

.post-title a {
    color: var(--text-color);
    transition: color var(--transition-fast);
}

.post-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

.read-more i {
    margin-left: var(--spacing-xs);
    transition: transform var(--transition-fast);
}

.read-more:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* ======================================================
   BLOG SIDEBAR FIXES
   ====================================================== */

/* Sidebar styling */
.sidebar-widget {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--divider-color);
}

.categories-list,
.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li,
.recent-posts-list li {
    margin-bottom: var(--spacing-xs);
}

.categories-list a,
.recent-posts-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    color: var(--text-color);
    transition: color var(--transition-fast);
}

.categories-list a:hover,
.recent-posts-list a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.count {
    font-size: var(--font-size-xs);
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: var(--border-radius-pill);
}

.post-date {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* ======================================================
   INDIVIDUAL BLOG POST FIXES
   ====================================================== */

/* Author section fixes in single post */
.post-author {
    display: flex;
    align-items: center;
    margin: var(--spacing-md) 0;
}

.author-avatar {
    width: 40px !important;
    /* Reduced from original size */
    height: 40px !important;
    /* Reduced from original size */
    border-radius: 50%;
    margin-right: var(--spacing-sm);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.author-role {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin: 0;
}

/* Tags section in horizontal layout */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--divider-color);
}

.post-tags span {
    margin-right: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tags-list li {
    margin: 0 var(--spacing-xs) var(--spacing-xs) 0;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* Single blog post styling */
.blog-post-single {
    padding: var(--spacing-lg);
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.post-header {
    margin-bottom: var(--spacing-lg);
}

.post-content {
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.post-content h2 {
    margin-top: var(--spacing-xl);
    font-size: var(--font-size-2xl);
}

.post-content h3 {
    margin-top: var(--spacing-lg);
    font-size: var(--font-size-xl);
}

.post-content ul,
.post-content ol {
    margin-bottom: var(--spacing-md);
}

.post-content img {
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    height: auto;
    margin: var(--spacing-md) 0;
}

/* Post navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--divider-color);
}

.prev-post,
.next-post {
    padding: var(--spacing-md);
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.prev-post:hover,
.next-post:hover {
    background-color: var(--background-color);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.next-post {
    text-align: right;
}

.nav-label {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.prev-post .nav-label {
    justify-content: flex-start;
}

.prev-post .nav-label i {
    margin-right: var(--spacing-xs);
}

.next-post .nav-label {
    justify-content: flex-end;
}

.next-post .nav-label i {
    margin-left: var(--spacing-xs);
}

.nav-title {
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
}

/* ======================================================
   RELATED POSTS SECTION FIXES
   ====================================================== */

/* Fix "You May Also Like" section */
.related-content-section {
    background-color: var(--background-secondary);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.related-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px; /* Center the grid */
}

.related-post {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.related-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-post a {
    color: var(--text-color);
    text-decoration: none;
}

.related-post h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.related-post p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* ======================================================
   ADVERTISEMENTS STYLING
   ====================================================== */

/* Ad container styling */
.ad-container {
    position: relative;
    margin: var(--spacing-xl) auto;
    padding: 0; /* Remove padding to eliminate extra space */
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    text-align: center;
    max-width: 800px;
}

.ad-label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 6px;
    font-size: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-bottom-left-radius: 3px;
    font-weight: 400;
}

.ad-content {
    width: 100%;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    .ad-label {
        background-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.6);
    }
}

/* ======================================================
   PAGINATION STYLING
   ====================================================== */

/* Pagination styling */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-sm);
    height: 36px;
    min-width: 36px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    background-color: var(--background-secondary);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.pagination-link:hover,
.pagination-link.active {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* ======================================================
   RESPONSIVE ADJUSTMENTS
   ====================================================== */

@media (max-width: 768px) {
    .post-navigation {
        grid-template-columns: 1fr;
    }

    .next-post {
        margin-top: var(--spacing-sm);
    }

    .related-posts {
        grid-template-columns: 1fr;
    }

    .post-author {
        flex-direction: column;
        align-items: flex-start;
    }

    .author-avatar {
        margin-bottom: var(--spacing-xs);
    }
}

/* Further adjustments for tag vertical alignment */

/* Tag item container adjustment - move down */
.tag-item-inline-fix {
    height: 28px !important;
    margin: 0 !important;
    position: relative !important;
    top: 4px !important;
    /* Increased to 3px to move tags further down */
}

/* Tag label positioning */
.tag-label-inline-fix {
    height: 28px !important;
    line-height: 28px !important;
    margin: 0 !important;
    vertical-align: baseline !important;
}

/* More specific selector for stronger specificity */
article.blog-post-single .tags-list li a.tag {
    position: relative !important;
    top: 4px !important;
    /* Adjust this value as needed */
    display: inline-block !important;
    height: 28px !important;
    line-height: 28px !important;
    padding: 0 10px !important;
}

/* Alternative approach using transform for more precise adjustment */
.tags-list-inline-fix li {
    transform: translateY(4px) !important;
    /* Move down by 3px */
}

/* Styling for tags cloud in sidebar */

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tags-cloud .tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
}

.tags-cloud .tag:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.tags-cloud .tag .count {
    margin-left: 6px;
    background-color: rgba(var(--text-color-rgb), 0.1);
    padding: 1px 6px;
    border-radius: var(--border-radius-pill);
    font-size: calc(var(--font-size-xs) * 0.9);
}

.tags-cloud .tag:hover .count {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Style adjustments for different tag sizes based on frequency */
.tags-cloud .tag-size-1 {
    font-size: 0.75rem;
}

.tags-cloud .tag-size-2 {
    font-size: 0.8rem;
}

.tags-cloud .tag-size-3 {
    font-size: 0.85rem;
}

.tags-cloud .tag-size-4 {
    font-size: 0.9rem;
}

.tags-cloud .tag-size-5 {
    font-size: 0.95rem;
}

/* 
 * Further refined product card design
 */

/* Only target homepage product cards */
.home .product-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.home .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Product icon section - increased height */
.home .product-card .product-icon {
    padding: var(--spacing-lg);
    min-height: 120px;
    /* Increased padding */
    display: flex;
    justify-content: center;
    background-color: var(--background-secondary);
    width: 100%;
}

.home .product-card .product-icon img {
    width: 70px;
    height: 70px;
    border-radius: 22%;
}

/* Product info section */
.home .product-card .product-info {
    padding: var(--spacing-sm) var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Title row with badges */
.home .product-card .title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    /* Reduced to bring list closer to title */
}

.home .product-card h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

/* Platform badges */
.home .product-card .platform-badges {
    display: flex;
    gap: 4px;
}

.home .product-card .platform-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.home .product-card .platform-badge i {
    margin-right: 3px;
    font-size: 9px;
}

/* Feature list - larger font and increased line height */
.home .product-card .feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2px 0;
    /* Reduced bottom margin to bring closer to button */
}

.home .product-card .feature-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
    /* Increased spacing between list items */
    font-size: 16px;
    /* Increased font size */
    color: var(--text-secondary);
    line-height: 1.6;
    /* Increased line height */
}

.home .product-card .fas.fa-check {
    color: var(--primary-color);
    margin-right: 6px;
    flex-shrink: 0;
    font-size: 11px;
    /* Slightly larger check icon */
    margin-top: 4px;
}

/* Learn More button - increased height */
.home .product-card .learn-more-btn {
    margin-top: 0;
    /* Reduced to be closer to list */
    /* margin-bottom: var(--spacing-xs); */
    align-self: flex-start;
}

.home .product-card .button-sm {
    padding: 6px 16px;
    /* Taller button */
    font-size: 14px;
    /* Slightly larger font */
    border-radius: var(--border-radius-pill);
    min-width: 110px;
    text-align: center;
}

/* Store badges area */
.home .product-card .store-badges-container {
    /* padding: var(--spacing-sm) var(--spacing-md); */
    padding-left: 16px;
    padding-bottom: 12px;
    background-color: #f8f8fa;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    align-items: center;
    /* Center vertically */
    height: 70px;
    /* Fixed height for the container */
}

/* Store badges - increased height */
.home .product-card .store-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 42px;
    /* Increased height */
}

.home .product-card .app-store-badge,
.home .product-card .google-play-badge {
    display: flex;
    align-items: center;
    height: 42px;
    /* Increased height */
}

.home .product-card .app-store-badge img,
.home .product-card .google-play-badge img {
    height: 42px;
    /* Increased height */
    width: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .home .product-card .title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .home .product-card .platform-badges {
        margin-top: 2px;
    }
}

/* App Store Editor's Choice */
.app-highlight-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.copyright-link {
    color: #1d1d1f !important;
    transition: color 0.3s ease;
    text-decoration: none;
}

.copyright-link:hover {
    color: #1d1d1f !important;
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .copyright-link {
        color: #f5f5f7 !important;

        .copyright-link:hover {
            color: #f5f5f7 !important;
        }
    }
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-sm);
}

.footer-extras {
    margin-top: var(--spacing-xs);
}

.notfound-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.notfound-link:hover {
    color: var(--primary-color);
}

.notfound-link i {
    color: var(--error-color);
    margin-right: var(--spacing-xs);
}