/* Fix alignment for Resources dropdown items */
.dropdown-item.megamenu-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    color: #4b5563 !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
    padding: 10px 15px !important;
}

.dropdown-item.megamenu-item i {
    width: 20px !important;
    color: #9ca3af !important;
    transition: color 0.2s !important;
    font-size: 1rem !important;
    text-align: center !important;
}

.dropdown-item.megamenu-item:hover {
    color: #2596be !important;
    background-color: #f8f9fa !important;
    transform: none !important;
}

.dropdown-item.megamenu-item:hover i {
    color: #2596be !important;
}

/* Style Contact us dropdown icons to match Resources menu */
.dropdown-menu .dropdown-item .bg-success-subtle,
.dropdown-menu .dropdown-item .bg-primary-subtle,
.dropdown-menu .dropdown-item .bg-info-subtle {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.875rem !important;
}

.dropdown-menu .dropdown-item .bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #16a34a !important;
}

.dropdown-menu .dropdown-item .bg-primary-subtle {
    background-color: #dbeafe !important;
    color: #2563eb !important;
}

.dropdown-menu .dropdown-item .bg-info-subtle {
    background-color: #e0f2fe !important;
    color: #0284c7 !important;
}

.dropdown-menu .dropdown-item:hover .bg-success-subtle,
.dropdown-menu .dropdown-item:hover .bg-primary-subtle,
.dropdown-menu .dropdown-item:hover .bg-info-subtle {
    background-color: #f1f5f9 !important;
    color: #2596be !important;
}

/* Override Blesta default success buttons to match theme green */
.btn-success {
    background-color: #116f48 !important;
    border-color: #116f48 !important;
    color: white !important;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
    background-color: #0d5639 !important;
    border-color: #0d5639 !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 111, 72, 0.2);
}

/* Override Primary buttons to match Brand Blue */
.btn-primary {
    background-color: #2596be !important;
    border-color: #2596be !important;
    color: white !important;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1e7a9b !important;
    border-color: #1e7a9b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 150, 190, 0.2);
}

/* Ensure order links in lists look like buttons if they use the class */
a.btn-success, a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Knowledge Base Styling */
.card-kb.bg-light {
    background-color: white !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-radius: 12px !important;
    padding: 30px !important;
    margin-bottom: 30px;
}

.card-kb .input-group {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.card-kb .form-control {
    border: 1px solid #e5e7eb;
    padding: 15px 20px;
    height: auto;
    font-size: 1rem;
}

.card-kb .form-control:focus {
    border-color: #2596be;
    box-shadow: none;
}

.card-kb .btn-secondary {
    background-color: #2596be !important;
    border-color: #2596be !important;
    color: white !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 12px 25px;
}

.card-kb .btn-secondary:hover {
    background-color: #1e7a9b !important;
    border-color: #1e7a9b !important;
}

.section-title h3 {
    color: #111827;
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h3 i {
    color: #2596be;
}

.section-title p {
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 25px;
}

.categories .alert-info {
    background-color: #eaf8ff;
    border-color: #bde0fe;
    color: #2596be;
    border-radius: 8px;
    font-weight: 500;
    padding: 15px 20px;
}

.categories .alert-info p {
    margin-bottom: 0;
}

/* Registration Form Styling */
#sign-up.card-blesta {
    border: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    background: #fff;
}

#sign-up .card-header {
    background: #116f48;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 20px 30px;
    border-bottom: none;
}

#sign-up .card-body {
    padding: 40px;
}

#sign-up h4 {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-top: 10px;
}

#sign-up .form-group {
    margin-bottom: 20px;
}

#sign-up label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
}

#sign-up .form-control {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 15px;
    height: auto;
    font-size: 1rem;
    background-color: #f9fafb;
    transition: all 0.2s;
}

#sign-up .form-control:focus {
    background-color: #fff;
    border-color: #2596be;
    box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.1);
}

#sign-up hr {
    margin: 30px 0;
    border-top-color: #e5e7eb;
}

/* Submit Button */
#sign-up button[type="submit"] {
    background-color: #116f48;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

#sign-up button[type="submit"]:hover {
    background-color: #0d5639;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 111, 72, 0.3);
}

/* Turnstile/Captcha Container */
#sign-up .cf-turnstile {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* Well/Box for email marketing */
#sign-up .well {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Mobile responsiveness adjustments */
@media (max-width: 768px) {
    #sign-up .card-body {
        padding: 20px;
    }
}

/* Fix for dropdown menu going off screen */
.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* Increase font size of submenu items */
.dropdown-item, .megamenu-item {
    font-size: 1.05rem !important;
}

/* Active list group item styling */
a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus {
    background-color: #2596be !important;
    border-color: #2596be !important;
    color: #ffffff !important;
}

/* Fix modal backdrop not covering full width when body gets scrollbar padding */
.modal-open .modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    background-color: #000;
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: var(--bs-backdrop-opacity, 0.5); }

/* Fix for btn-light to make it colored instead of white */
.btn-light {
    background-color: #2596be !important;
    border-color: #2596be !important;
    color: white !important;
    font-weight: 600;
}
.btn-light:hover {
    background-color: #1e7a9b !important;
    border-color: #1e7a9b !important;
    color: white !important;
}

/* Fix for btn-default to make it colored */
.btn-default {
    background-color: #2596be !important;
    border-color: #2596be !important;
    color: white !important;
    font-weight: 600;
}
.btn-default:hover {
    background-color: #1e7a9b !important;
    border-color: #1e7a9b !important;
    color: white !important;
}

    /* Search Results Info Styles */
    .blog-post-container {
        padding: 2rem 1rem 4rem;
        background-color: #fff !important;
        min-height: 100vh;
        max-width: 1800px;
        margin: 0 auto;
    }

/* Client area secondary navbar (Dashboard/Services/etc.) mobile tweaks */
@media (max-width: 991px) {
    .nav-content .navbar {
        background-color: #111827;
        border-bottom: none;
    }

    .nav-content .navbar-toggler {
        border-color: rgba(255,255,255,0.5) !important;
    }
    
    .nav-content .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%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    .nav-content .navbar-collapse {
        background-color: #111827;
        padding: 12px 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    }

    .nav-content .nav-link {
        color: #e5e7eb !important;
        font-weight: 600;
        border-bottom: 1px solid rgba(55, 65, 81, 0.9);
        padding: 10px 0 !important;
    }

    .nav-content .nav-link:hover {
        color: #ffffff !important;
    }

    .nav-content .nav-link i.fa-chevron-down {
        color: #9ca3af;
    }

    .nav-content .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

/* Invoices widget: avoid horizontal scroll on wider screens */
@media (min-width: 768px) {
  #client_invoices th,
  #client_invoices td {
    white-space: normal !important;
  }

  #client_invoices .btn-group,
  #client_invoices .btn-group .btn,
  #client_invoices .btn-group .dropdown-toggle {
    white-space: normal !important;
  }

  #client_invoices .btn-group {
    flex-wrap: wrap;
  }
}