/* FleetOps Help Site Custom CSS - Refined with Updated Layout */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

/* Main container for the help site - wider container */
.help-site-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header section - reduced margin */
.help-header {
    text-align: center;
    margin-bottom: 35px;
}

.help-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.help-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 0;
}

/* Categories grid layout - wider cards for desktop */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Individual category card - shorter height */
.category-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 25px;
    text-align: left;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(248,249,250,1) 100%);
}

/* Special compact design for categories without subcategories */
.category-card.no-subcategories {
    min-height: 140px;
    padding: 20px;
    justify-content: center;
    text-align: center;
}

.category-card.no-subcategories .category-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-bottom: none;
}

.category-card.no-subcategories .category-title {
    font-size: 1.5rem;
    margin-right: 0;
    text-align: center;
}

.category-card.no-subcategories .category-content {
    display: block;
    text-align: center;
}

/* Category header with title and view all button - tighter spacing */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Category title - larger text */
.category-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    text-decoration: none;
    display: block;
    line-height: 1.2;
    flex-grow: 1;
    margin-right: 15px;
    letter-spacing: -0.5px;
}

.category-title:hover {
    color: #1B87BD;
    text-decoration: none;
}

/* View all button - FIXED for better readability with high contrast */
.view-all-btn {
    color: #ffffff !important;
    background: #1B87BD !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding: 10px 16px;
    border: 2px solid #1B87BD;
    border-radius: 6px;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(27, 135, 189, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-btn:hover {
    background: #E53E5D !important;
    border-color: #E53E5D !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 93, 0.4);
    text-decoration: none;
    color: #ffffff !important;
}

/* UPDATED: Category description styling - closer to title and similar styling */
.category-description {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.category-description p {
    color: #555;
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Articles and subcategories layout - single column */
.category-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
}

/* NUCLEAR OPTION - REMOVE ALL COLORED BARS FROM ARTICLES */

/* Individual content sections - remove any colored borders */
.category-articles,
.subcategories {
    margin: 0;
}

/* Override any possible source of colored bars with maximum specificity */
.help-site-container .category-card .category-content .category-articles,
.help-site-container .category-card .category-content .category-articles *,
.help-site-container .category-card .category-content .category-articles ul,
.help-site-container .category-card .category-content .category-articles li,
.help-site-container .category-card .category-content .category-articles a {
    border-left: none !important;
    border-right: none !important;
    background-image: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Target the specific elements that might have the colored bars */
.category-articles,
.category-articles *,
.category-articles ul,
.category-articles li {
    border: none !important;
    border-left: none !important;
    background: transparent !important;
    box-shadow: none !important;
    background-image: none !important;
    background-color: transparent !important;
}

/* Override any Teamwork default styles */
.list-links,
.list-links li,
.list-links li a,
.articles--group,
.section-content,
.section-content ul,
.section-content li,
.section-content a {
    border-left: none !important;
    background: transparent !important;
    border: none !important;
}

/* Hide any pseudo elements that might create colored bars */
.category-articles::before,
.category-articles::after,
.category-articles *::before,
.category-articles *::after,
.category-articles ul::before,
.category-articles ul::after,
.category-articles li::before,
.category-articles li::after {
    display: none !important;
    content: none !important;
    border: none !important;
    background: none !important;
}

/* Override any inherited styles from parent elements */
.category-content .category-articles {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* UPDATED: Articles section - 2x2 grid for 4 articles */
.category-articles {
    margin-bottom: 16px;
}

.category-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.category-articles li {
    margin: 0;
}

/* Add "Most Popular" label */
.category-articles::before {
    content: "Most Popular";
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.category-articles h4,
.subcategories h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hide the "Recent Articles" heading */
.category-articles h4 {
    display: none;
}

/* Subcategories section - horizontal flex layout */
.subcategories ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}

.subcategories li {
    flex: 1;
    min-width: 140px;
}

/* UPDATED: Article styling with full borders */
.category-articles a {
    color: #4a5568 !important;
    text-decoration: none !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    line-height: 1.4 !important;
    display: block !important;
    padding: 12px 14px !important;
    border-radius: 6px !important;
    border: 1px solid #d1d5db !important;
    background: rgba(255,255,255,0.9) !important;
    background-color: rgba(255,255,255,0.9) !important;
    background-image: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.category-articles a:hover {
    color: #1B87BD !important;
    background-color: rgba(255,255,255,1) !important;
    border: 1px solid #1B87BD !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(27, 135, 189, 0.2) !important;
}

/* Keep subcategories styling with different appearance - lighter and more subdued */
.subcategories a {
    color: #6c757d;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1.3;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(248,249,250,0.5);
    text-align: center;
}

.subcategories a:hover {
    color: #1B87BD;
    background: rgba(248,249,250,0.9);
    border-color: rgba(27, 135, 189, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(27, 135, 189, 0.15);
}

/* Make it clear these navigate away with an external indicator */
.subcategories a::after {
    content: "→";
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-size: 0.9em;
}

.subcategories a:hover::after {
    opacity: 1;
}

/* Hide article count completely */
.card-footer,
.article-count {
    display: none !important;
}

/* HIDE ALL SUBCATEGORY CARDS - Based on actual category IDs from your site */
.category-964,
.category-915, 
.category-956,
.category-937,
.category-936,
.category-944,
.category-957,
.category-914,
.category-907,
.category-954,
.category-953 {
    display: none !important;
}

/* Keep only these main category cards visible: */
/* category-917 (Sign up & Log in) */
/* category-941 (Navigating the System) */
/* category-949 (Connector Management) */
/* category-906 (User Management) */
/* category-918 (Billing Management) */
/* category-942 (Sharing Content) */
/* category-952 (Managing AX Settings) */
/* category-938 (Content Editing) */
/* category-911 (Wallboards Management) */

/* ACTUAL CATEGORY IDs - MIXED FLEETOPS BRAND COLORS */

/* Sign up & Log in - ID: 917 - Primary Red */
.category-917 { border-left: 5px solid #E53E5D; }
.category-917 .category-title { color: #E53E5D; }

/* Navigating the System - ID: 941 - Dark Gray */
.category-941 { border-left: 5px solid #333333; }
.category-941 .category-title { color: #333333; }

/* Connector Management - ID: 949 - FleetOps Blue */
.category-949 { border-left: 5px solid #1B87BD; }
.category-949 .category-title { color: #1B87BD; }

/* User Management - ID: 906 - Medium Gray */
.category-906 { border-left: 5px solid #888888; }
.category-906 .category-title { color: #888888; }

/* Billing Management - ID: 918 - Light Pink */
.category-918 { border-left: 5px solid #F06A94; }
.category-918 .category-title { color: #F06A94; }

/* Sharing Content - ID: 942 - Dark Header Color */
.category-942 { border-left: 5px solid #09090B; }
.category-942 .category-title { color: #09090B; }

/* Managing AX Settings - ID: 952 - FleetOps Blue */
.category-952 { border-left: 5px solid #1B87BD; }
.category-952 .category-title { color: #1B87BD; }

/* Content Editing - ID: 938 - Primary Red */
.category-938 { border-left: 5px solid #E53E5D; }
.category-938 .category-title { color: #E53E5D; }

/* Wallboards Management - ID: 911 - Dark Gray */
.category-911 { border-left: 5px solid #333333; }
.category-911 .category-title { color: #333333; }

/* Search functionality */
.search-container {
    max-width: 600px;
    margin: 0 auto 35px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.15rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.search-input:focus {
    border-color: #1B87BD;
    box-shadow: 0 0 0 3px rgba(27, 135, 189, 0.1);
}

/* Special styling for categories without subcategories */
.category-card.no-subcategories {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
}

.category-card.no-subcategories .category-title {
    margin-bottom: 0;
    font-size: 1.5rem;
}

/* Subcategory indicator */
.subcategory-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
}

.subcategory-indicator small {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive design */
@media (max-width: 992px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px;
    }
    
    .help-site-container {
        max-width: 100%;
        padding: 25px 20px;
    }
}

@media (max-width: 768px) {
    .help-header h1 {
        font-size: 2rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-card {
        padding: 18px 16px;
        min-height: 160px;
    }
    
    .category-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    
    .help-site-container {
        padding: 20px 15px;
    }
    
    /* Mobile - stack articles vertically */
    .category-articles ul {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    /* Mobile - stack subcategories vertically */
    .subcategories ul {
        flex-direction: column;
        gap: 8px;
    }
    
    .subcategories li {
        min-width: auto;
        flex: none;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .view-all-btn {
        font-size: 0.9rem;
        padding: 8px 14px;
    }
    
    /* Mobile description styling */
    .category-description p {
        font-size: 1.2rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .help-header h1 {
        font-size: 1.75rem;
    }
    
    .category-title {
        font-size: 1.4rem;
    }
    
    .category-card {
        padding: 16px 12px;
        min-height: 150px;
    }
    
    .view-all-btn {
        font-size: 0.85rem;
        padding: 7px 12px;
    }
    
    /* Smaller mobile description */
    .category-description p {
        font-size: 1.1rem;
    }
}

/* Animation */
.category-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }
.category-card:nth-child(7) { animation-delay: 0.7s; }
.category-card:nth-child(8) { animation-delay: 0.8s; }
.category-card:nth-child(9) { animation-delay: 0.9s; }
.category-card:nth-child(10) { animation-delay: 1.0s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer - reduced margin */
.help-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.95rem;
}

/* Utility classes */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }

/* Accessibility */
.category-card:focus,
.category-title:focus,
.subcategories a:focus {
    outline: 2px solid #1B87BD;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .category-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .category-description p {
        color: #333;
        font-style: normal;
    }
}