/* Help section styles extracted from inline <style> in help2/sidebar.php */

/* Common Layout */
.content-container {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.content-area {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 60px);
}

/* Sidebar Container */
.sidebar-container-help {
    padding: 0;
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    .sidebar-container-help { max-width: 300px; }
}

/* Desktop Sidebar */
.help-sidebar {
    background-color: #ebf4fa !important;
    border-right: 1px solid #d9e8f5 !important;
    height: 100%;
    min-height: calc(100vh - 0px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    -ms-overflow-style: none;   /* hide scrollbar IE/Edge */
    scrollbar-width: none;      /* hide scrollbar Firefox */
}
.help-sidebar::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
    .help-sidebar { max-width: 300px; }
}

.help-sidebar .sidebar-header {
    background-color: #ebf4fa;
    color: #011e61;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f8f9fa;
}
.help-sidebar .sidebar-header h5 { margin: 0; font-weight: 600; }

/* Navigation items */
.help-sidebar .nav-item { width: 100%; border-bottom: 1px solid #f8f9fa; }
.help-sidebar .nav-item:last-child { border-bottom: none; }

/* Group container */
.help-sidebar .nav-link-group-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Title links */
.help-sidebar .nav-link-title {
    color: #011e61;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 12px 16px;
    display: inline-block;
}
.help-sidebar .nav-link-title:hover,
.help-sidebar .nav-link-title:focus { background-color: #d7fade; text-decoration: none; }

/* Toggle icon */
.help-sidebar .toggle-icon {
    font-weight: bold;
    cursor: pointer;
    padding: 12px 16px;
    margin-left: auto;
    user-select: none;
}

/* Generic nav-link */
.help-sidebar .nav-link {
    color: #011e61;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 16px;
    transition: all 0.2s ease;
    font-size: 0.95em;
    border-radius: 4px;
    margin: 0;
}
.help-sidebar .nav-link.active { background-color: #d9e8f5; color: #011e61; }

/* Sub-menu */
.help-sidebar ul.collapse { background-color: #f0f8ff; margin-left: 0; padding-left: 0; border-left: none; }
.help-sidebar ul.collapse.show { margin-left: 15px; padding-left: 15px; border-left: 1px solid #011e61; }
.help-sidebar .nav-item-sub .nav-link.sub-link { font-size: 0.85em; font-weight: normal; padding: 10px 15px; display: block; }
.help-sidebar .nav-item-sub .nav-link.sub-link:hover { background-color: #d7fade; }
.help-sidebar ul.collapse .nav-item-sub { border-bottom: 1px solid #e0f0fb; }
.help-sidebar ul.collapse .nav-item-sub:last-child { border-bottom: none; }

/* Mobile Navbar */
.help-navbar {
    background-color: #ebf4fa;
    border-bottom: 1px solid #d9e8f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding-top: .5rem;
    padding-bottom: .5rem;
}
.help-navbar .navbar-brand { color: #011e61; font-weight: 600; }
.help-navbar .navbar-toggler { border-color: rgba(1, 30, 97, 0.25); }
.help-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(1, 30, 97, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.help-navbar .navbar-nav .nav-item { border-bottom: 1px solid #e0f0fb; }
.help-navbar .navbar-nav .nav-item:last-child { border-bottom: none; }
.help-navbar .navbar-nav .nav-link-title { color: #011e61; font-weight: 500; text-decoration: none; display: inline-block; padding: 10px 12px; }
.help-navbar .navbar-nav .nav-link-title:hover,
.help-navbar .navbar-nav .nav-link-title:focus { background-color: #d7fade; }
.help-navbar .navbar-nav .toggle-icon { cursor: pointer; padding: 10px 12px; font-weight: bold; user-select: none; }
.help-navbar .navbar-nav ul.collapse { background-color: #f0f8ff; margin-left: 0; padding-left: 0; border-left: none; }
.help-navbar .navbar-nav ul.collapse.show { margin-left: 10px; padding-left: 10px; border-left: 1px solid #011e61; }
.help-navbar .navbar-nav ul.collapse .nav-link.sub-link { font-size: 0.9em; padding-left: 1.5rem; }

/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.card-item {
    min-width: 0;
    width: 100%;
}

.card {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease;
    cursor: pointer;
    height: 100%;
    margin-bottom: 0;
}

/* Image and Placeholder Styles */
.map-sample.aspect-16-9 {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    min-height: 0;
    border: 2px solid #011e61;
}

.card-img-container {
    overflow: hidden;
    padding-top: 56.25%;
    position: relative;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.card-img-container img,
.card-img-container picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-card-placeholder {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: pulse 1.5s ease-in-out infinite;
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.img-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #dee2e6;
    border-top: 0.25em solid #011e61;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* Prevent image zoom on hover within documentation cards to avoid border artifacts */
.content-area .card:hover .card-img-top {
    transform: none !important;
}

.card-body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1.25rem;
}

.card-title {
    color: #011e61;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.1rem;
    min-height: 2.5rem;
    display: flex;
    align-items: start;
}

.card-text {
    color: #6c757d;
    margin-bottom: 1rem;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
    content: "";
    background-color: rgba(0,0,0,0);
}

/* Search dropdown styles */
.search-container .topic-result {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.search-container .topic-result:hover {
    background-color: #f8f9fa;
}

.search-container .topic-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container .highlight {
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
    font-weight: bold;
}

/* Search dropdown from maps.css */
#search-dropdown {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
}

#search-dropdown:not(.d-none) {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Boundaries Page Styles */

/* Introduction Section */
.custom-boundaries-intro .lead {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.6;
}

/* Featured Video Section */
.featured-video-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #dee2e6;
}

.featured-video-section h2 {
    color: #011e61;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.video-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Help Sections */
.help-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e3e6f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.help-section:last-of-type {
    border-bottom: none;
}

.section-title {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.section-intro {
    color: #6c757d;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Method Sections */
.method-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #007bff;
}

.method-title {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Steps Container */
.steps-container {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

.steps-container h3 {
    color: #011e61;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Custom Steps List */
.custom-steps-list {
    list-style: none !important;
    padding-left: 0 !important;
    counter-reset: step-counter;
}

.custom-steps-list li {
    counter-increment: step-counter;
    margin-bottom: 1rem;
    padding-left: 3rem;
    position: relative;
    line-height: 1.6;
}

.custom-steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #011e61;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
}

.custom-steps-list li:last-child {
    margin-bottom: 0;
}

/* Features Section */
.features-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #e3e6f0;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.feature-card p {
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Testimonial Section */
.testimonial-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #b8daff;
    text-align: center;
}

.testimonial-card {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.testimonial-text {
    font-style: italic;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.testimonial-author {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 0;
}

/* Related Topics Section */
.related-topics-section h3 {
    color: #011e61;
    font-weight: 600;
    margin-bottom: 1rem;
}

.related-links {
    list-style: none;
    padding-left: 0;
}

.related-links li {
    margin-bottom: 0.5rem;
}

.related-links a {
    color: #007bff;
    text-decoration: none;
    padding: 0.5rem 0;
    display: inline-block;
    transition: all 0.2s ease;
    position: relative;
    padding-left: 1.5rem;
}

.related-links a::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #007bff;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.related-links a:hover {
    color: #0056b3;
    transform: translateX(5px);
}

.related-links a:hover::before {
    transform: translateX(5px);
}

/* Help Contact Section */
.help-contact {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    border: 2px solid #bee5eb;
}

.help-contact p {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.help-contact a {
    color: #0c5460;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid #0c5460;
    transition: all 0.2s ease;
}

.help-contact a:hover {
    color: #062c33;
    border-bottom-color: #062c33;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-area {
        border-radius: 0;
        margin: 0;
        padding: 1rem;
    }
    
    .help-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .method-section {
        padding: 1rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .custom-steps-list li {
        padding-left: 2.5rem;
    }
    
    .custom-steps-list li::before {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }
    
    .video-container {
        padding: 0.5rem;
    }
    
    .testimonial-section {
        padding: 1.5rem;
    }
    
    .related-topics-section {
        padding: 1.5rem;
    }
    
    .help-contact {
        padding: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .rounded-circle {
        width: 50px !important;
        height: 50px !important;
    }

    .display-5 {
        font-size: 2rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-img-container {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .card-img-container {
        height: 160px;
    }
}

/* Additional Bootstrap icon color utilities */
.text-purple {
    color: #6f42c1 !important;
}

/* Button hover effects
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}*/

/* Breadcrumb enhancements */
.breadcrumb {
    background-color: #f8f9fa;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
}

.breadcrumb-item {
    padding: 0.1rem 0.1rem 0.1rem 0.1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
    padding-left: 0.1rem;
}

.breadcrumb a {
    color: #0077cc;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
}

.breadcrumb a:hover {
    color: #005fa3;
    text-decoration: none !important;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 600;
}

/* Aspect ratio utilities for older browsers */
.aspect-16-9 {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
}

.aspect-16-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Enhanced card hover states
.card.border-primary:hover {
    border-color: #0056b3 !important;
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.15);
}

.card.border-success:hover {
    border-color: #157347 !important;
    box-shadow: 0 8px 25px rgba(21, 115, 71, 0.15);
}

.card.border-info:hover {
    border-color: #087990 !important;
    box-shadow: 0 8px 25px rgba(8, 121, 144, 0.15);
}

.card.border-warning:hover {
    border-color: #997404 !important;
    box-shadow: 0 8px 25px rgba(153, 116, 4, 0.15);
}
*/


/* Print styles */
@media print {
    .help-sidebar {
        display: none;
    }
    
    .content-container {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .video-container {
        display: none;
    }
}

/* Page layout fixes for wide screens */
body, html {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#help-center {
    min-height: calc(100vh - 200px);
    width: 100%;
}

/* Disable image scaling on hover for specific cards */
.no-hover-scale:hover .card-img-top {
    transform: none !important;
}

.no-hover-scale .card-img-top {
    transition: transform 0s; /* Remove transition */
}

/* Disable hover effects for cards within .no-hover rows */
.no-hover .card {
    
    cursor: default !important;
}

/* Helper max-width container matching card-grid */
.helper-max {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

@media (min-width: 768px) {
    .helper-max { max-width: 900px; padding-left:1rem; padding-right:1rem; }
}
@media (min-width: 992px) {
    .helper-max { max-width: 1200px; padding-left:2rem; padding-right:2rem; }
}
@media (min-width: 1200px) {
    .helper-max { max-width: 1400px; padding-left:2rem; padding-right:2rem; }
}
@media (min-width: 1400px) {
    .helper-max { max-width: 1700px; padding-left:3rem; padding-right:3rem; }
}
@media (min-width: 1600px) {
    .helper-max { max-width: 2000px; padding-left:4rem; padding-right:4rem; }
}
@media (min-width: 1920px) {
    .helper-max { max-width: 2200px; padding-left:5rem; padding-right:5rem; }
}

@media (min-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Disable hover lift effect for help documentation cards (non-app cards) */
.content-area .card:hover {
    transform: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    border-color: inherit !important; /* preserve original border color */
}

/* Remove transition for these cards to prevent subtle movement */
.content-area .card {
    transition: none !important;
    cursor: default !important;
    border: 1px solid #dee2e6 !important;
}

.content-area .card:hover {
    border: 1px solid #dee2e6 !important;
}

/* Application cards within content-area - override the above rules */
#app-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    cursor: pointer !important;
    border: 1px solid #dee2e6 !important;
}

#app-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    border-color: #011e61 !important;
}

#app-card:hover .card-img-top {
    transform: none !important;
}

#app-card .card-img-top {
    transition: none !important;
}

#app-card .card-img-container picture,
#app-card .card-img-container img {
    padding: 0.75rem 0.75rem 0 0.75rem;
}

/* Restore hover lift for selected cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    cursor: pointer;
}
.hover-lift:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    border-color: #011e61 !important;
}

/* Padding for application card thumbnails on Help Center */
#help-center .card-img-container picture,
#help-center .card-img-container img {
    padding: 0.75rem 0.75rem 0 0.75rem;
}

/* ------------------------------------------------------------------
   Responsive fix for extra-wide screens (> 992px)
   Ensures sidebar stays 300px and content panel fills remaining width
   ------------------------------------------------------------------ */
@media (min-width: 992px) {
    .sidebar-container-help {
        flex: 0 0 300px !important; /* Fixed sidebar width */
        max-width: 300px !important;
        width: 300px !important;
    }
    .content-container {
        flex: 1 1 0% !important;   /* Grow to fill */
        max-width: none !important;
        width: auto !important;
    }
}
