:root {
    --primary-color: #fc4c69;
    --secondary-color: rgb(245, 237, 222);
    --accent-color: #2c5282;
    --text-color: #2d3748;
    --border-color: #e2e8f0;
    --hover-color: #fff;
    --text-muted: #718096;
    --text-light: #999;
    --text-dark: #000;
    --bg-light: #f8f9fa;
    --box-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --box-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    margin: 0 20px;
    padding: 0 40px;
}

.navbar {
    padding: 20px 0 0;
}

.navbar .container {
    max-width: 978px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.navbar a:hover {
    color: var(--primary-color);
}

.navbar i {
    font-size: 1rem;
}

.help-header {
    background: var(--secondary-color);
    margin: 0;
}

/* Container styles */
.categories-section .container {
    max-width: 978px;
    margin: 0 auto;
    padding: 0;
}

.help-header .container,
.article-header .container,
.article-content .container {
    max-width: 1140px;
    margin: 0;
    padding-left: 5.5rem;
    padding-right: 5.5rem;
    padding-top: 2rem;
    justify-self: center;
}

.help-header h1 {
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.search-container {
    width: 100%;
    margin: 2rem auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--hover-color);
    color: var(--text-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow-sm);
}

.search-input::placeholder {
    color: #A0AEC0;
}

.search-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow-lg);
    z-index: 1000;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
}

.search-category h6 {
    font-size: 0.875rem;
    color: #6c757d;
}

.search-results-dropdown .list-group-item {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid transparent;
}

.search-results-dropdown .list-group-item.active {
    border-color: #fc4c69;
    background-color: #f8f9fa;
    color: #fc4c69;
}

.categories-section {
    background: var(--secondary-color);
    margin: 0;
    padding: 40px 0;
}

@media (max-width: 768px) {
    .categories-section {
        justify-self: self-start;
    }
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 305px);
    gap: 30px;
    justify-content: center;
    padding: 20px 0;
}

.category-card {
    background: white;
    border-radius: 12px;
    height: 205px;
    display: flex;
    flex-direction: column;
    align-items: start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
    text-decoration: none;
    padding: 0.8rem;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border-color: var(--primary-color);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: start;
    justify-content: start;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.category-icon i {
    background: white;
}

@media (max-width: 768px) {
    .categories-section {
        justify-self: self-start;
    }
}

.category-card h3 {
    font-size: 1.1rem;
    text-align: start;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    background: white;
    transition: color 0.3s ease;
}

.category-card:hover h3 {
    color: var(--primary-color);
}

.category-card p {
    color: #718096;
    text-align: start;
    margin-bottom: 0;
    font-size: 0.95rem;
    background: white;
}

.popular-articles {
    padding: 4rem 0;
    background: white;
}

.article-link {
    display: block;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--secondary-color);
    margin-bottom: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-link:hover {
    transform: translateX(10px);
    background: var(--hover-color);
}

.article-link h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.article-link p {
    color: #718096;
    margin: 0;
    font-size: 0.95rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-color);
    text-align: center;
}

/* Article Pages */
.article-header {
    background: var(--secondary-color);
    text-align: left;
}

.article-header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.article-header .breadcrumb {
    justify-content: flex-start;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .article-header .breadcrumb {
        font-size: small;
        margin-bottom: 1rem;
    }
}

.article-header .lead {
    color: black;
    font-size: 1.2rem;
}

.article-content {
    padding: 1rem 0;
    background: var(--secondary-color);
}

.article-content .container {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

.article-content .row {
    width: 100%;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.article-content .col-lg-7 {
    flex: 1;
    min-width: 0;
    background: var(--secondary-color);
    border-radius: 12px;
    padding-left: 0;
    padding-right: 3rem;
}

.article-content .col-lg-3 {
    width: 250px;
    flex-shrink: 0;
    padding-right: 0;
}

.article-sidebar {
    position: sticky;
    top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.article-list,
.category-list {
    max-height: calc(50vh - 100px);
    overflow-y: auto;
    font-size: 0.875rem;
    padding-right: 0.5rem;
}

.article-list::-webkit-scrollbar,
.category-list::-webkit-scrollbar {
    width: 4px;
}

.article-list::-webkit-scrollbar-thumb,
.category-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.article-list .list-group-item,
.category-list .list-group-item {
    border: none;
    border-left: 3px solid transparent;
    padding: 0.3rem 0.3rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.article-list .list-group-item:hover,
.category-list .list-group-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.article-list .list-group-item.active,
.category-list .list-group-item.active {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
    color: var(--primary-color);
    font-weight: 500;
}

.article-sidebar h4 {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

/* Mobile styles */
.mobile-sidebar-dropdown {
    display: none;
}

/* Responsive container padding */
@media (max-width: 1200px) {
    .help-header .container,
    .article-header .container,
    .article-content .container {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (max-width: 992px) {
    /* Container padding */
    .help-header .container,
    .article-header .container,
    .article-content .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Article layout */
    .article-main {
        width: 100%;
    }

    .article-header h1 {
        font-size: 2rem;
    }
    
    /* Categories grid */
    .categories-grid {
        grid-template-columns: repeat(2, 350px);
    }
    
    /* Video container */
    .video-container {
        max-width: 100%;
        margin: 1.5rem auto;
    }
}

@media (max-width: 991px) {
    /* Article layout */
    .article-content .container {
        flex-direction: column;
        padding: 0 1rem;
    }

    .article-content .col-lg-7 {
        width: 100%;
        padding: 1.5rem;
    }

    .article-content .col-lg-3 {
        width: 100%;
    }

    /* Sidebar handling */
    .mobile-sidebar-dropdown {
        display: block;
        margin-bottom: 1rem;
    }

    .article-sidebar {
        display: none;
    }
    
    .mobile-sidebar-dropdown.show + .article-content .article-sidebar {
        display: none !important;
    }
}

/* Responsive styles - consolidated */
@media (max-width: 768px) {
    body {
        margin: 0 10px;
        padding: 0 20px;
    }

    /* Container styles */
    .help-header .container,
    .article-header .container,
    .article-content .container,
    .categories-section .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        max-width: 100%;
    }

    /* Article layout */
    .article-content .row {
        flex-direction: column;
        margin-left: 0;
        margin-right: 0;
    }

    .article-content .col-lg-7,
    .article-content .col-lg-3 {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Header styles */
    .help-header h1 {
        font-size: 2rem;
    }
    
    .article-header {
        padding-bottom: 2rem;
        padding-top: 0;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .article-header .lead {
        font-size: 1rem;
        margin-bottom: 0;
    }

    /* Search */
    .search-container {
        margin: 1.5rem auto;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(1, 350px);
        gap: 0.5rem;
        padding: 0;
    }

    .category-card {
        width: 100%;
        justify-self: center;
        margin: 0 -0.5rem 1.5rem -0.5rem;
        border-radius: var(--border-radius-lg);
        box-shadow: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* Sidebar */
    .article-sidebar {
        position: relative;
        top: 0;
        margin-top: 2rem;
        margin-bottom: 2rem;
        padding: 0;
        position: static;
    }

    .article-list,
    .category-list {
        max-height: none;
        margin: 0 -0.5rem;
    }

    .article-list .list-group-item,
    .category-list .list-group-item {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Main content */
    .article-main {
        border-radius: 0;
        margin: 0 -0.5rem 1rem -0.5rem;
        width: auto;
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .categories-grid {
        grid-template-columns: repeat(1, 350px);
    }
}

@media (max-width: 576px) {
    .article-main {
        padding: 1rem;
        box-shadow: none;
    }

    .article-main h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .article-main .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .article-main p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 0;
    }

    .article-main ul, 
    .article-main ol {
        font-size: 0.95rem;
        padding-left: 1.25rem;
    }

    .article-main img {
        max-width: 100%;
        height: auto;
    }
    
    .video-container {
        margin: 1rem auto;
        border-radius: var(--border-radius-sm);
    }
}

@media (min-width: 992px) {
    .mobile-sidebar-dropdown {
        display: none;
    }
}

/* Search Results Styling */
.search-result-content {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
}

.search-result-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.search-result-snippet {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-category {
    font-size: 0.75rem;
}

.search-result-category small {
    color: var(--text-light);
}

.search-results-dropdown .list-group-item {
    border: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-results-dropdown .list-group-item:hover {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
}

.search-results-dropdown .list-group-item.active {
    border-color: var(--primary-color);
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.search-results-dropdown .list-group-item.active .search-result-title {
    color: var(--primary-color);
}

.search-results-dropdown strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Video Container Styles */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .video-container {
        max-width: 100%;
        margin: 1.5rem auto;
    }
}

@media (max-width: 576px) {
    .video-container {
        margin: 1rem auto;
        border-radius: 4px;
    }
}

/* Footer */
.footer {
    background-color: var(--secondary-color); 
    color: var(--text-dark); 
    text-align: center; 
    display: flex;
    flex-direction: column; 
    align-items: center; 
    margin-bottom: 20px;
    padding: 20px;
}

.footer-links {
    background-color: var(--secondary-color);
    display: grid; 
    grid-template-columns: auto 1fr 1fr 1fr; /* Responsive grid */
    gap: 20px; 
    padding: 0 20px; 
    justify-items: center; 
    align-items: start; /* Align items to the start vertically */
    max-width: 1200px; /* Set a max width for the grid */
    width: 100%; /* Ensure the grid takes the full width of its container */
}

.footer-column img {
    width: 100px;
}

.footer-column h4 {
    margin-bottom: 20px; /* Space below the headings */
    font-size: 1.2em; /* Font size for headings */
}

.footer-column ul {
    list-style: none; /* This removes the bullet points */
    padding-left: 0; /* This removes any default left padding */
}

.footer-column ul li {
    margin: 5px 0;
}

.footer-column a {
    color: var(--text-dark); /* Footer link color */
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--primary-color); /* Hover color for links */
}

.footer p {
    margin-top: 50px;
    font-size: 0.8em; 
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }

    .cta1 h2 {
        font-size: 1.5rem;
        padding: 0 40px;
    }

    .footer-column img {
        background-color: rgb(245, 237, 222);
        width: 200px;
    }
}

/* Mobile Sidebar Dropdown */
.mobile-sidebar-dropdown {
    padding: 1rem 0;
    background: #fff;
    margin-bottom: 0;
}

.mobile-sidebar-dropdown .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-color: #e9ecef;
}

.mobile-sidebar-dropdown .btn:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.mobile-sidebar-dropdown .card {
    border: 1px solid #e9ecef;
    margin-top: 0.5rem;
}

.mobile-sidebar-dropdown .list-group-item {
    border: none;
    border-bottom: 1px solid #f1f1f1;
    padding: 0.75rem 1rem;
}

.mobile-sidebar-dropdown .list-group-item:last-child {
    border-bottom: none;
}

.mobile-sidebar-dropdown .list-group-item.active {
    background: #f8f9fa;
    color: var(--primary-color);
    font-weight: 500;
    border-color: #f1f1f1;
}

html {
    scroll-behavior: auto;
}

/* Breadcrumb styles */
.breadcrumb {
    --bs-breadcrumb-divider: ">";
}

.breadcrumb-item a {
    text-decoration: none;
    color: inherit;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: var(--bs-breadcrumb-divider);
    font-weight: 500;
}
