
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
}

/* High-contrast text selection for screen sharing visibility */
.managed-services-container ::selection {
    background-color: #D93636;
    color: #ffffff;
}

.managed-services-container ::-moz-selection {
    background-color: #D93636;
    color: #ffffff;
}

/* Table cell selection - extra prominent */
.services-table td::selection {
    background-color: #D93636;
    color: #ffffff;
}

.services-table td::-moz-selection {
    background-color: #D93636;
    color: #ffffff;
}

/* Table header selection - black background for contrast on red header */
.services-table th::selection,
.services-table thead::selection,
.services-table thead th::selection,
.services-table thead th *::selection {
    background-color: #000000;
    color: #ffffff;
}

.services-table th::-moz-selection,
.services-table thead::-moz-selection,
.services-table thead th::-moz-selection,
.services-table thead th *::-moz-selection {
    background-color: #000000;
    color: #ffffff;
}

/* Mobile accordion selection */
.mobile-accordion-view ::selection {
    background-color: #D93636;
    color: #ffffff;
}

.mobile-accordion-view ::-moz-selection {
    background-color: #D93636;
    color: #ffffff;
}

.managed-services-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 80px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h1 {
    font-size: 2.55rem;
    font-weight: 600;
    color: #393939;
    margin: 0;
    letter-spacing: -0.02em;
    flex-shrink: 1;
}

.export-btn {
    background-color: #ED3237;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.export-btn:hover {
    background-color: #EF4949;
    box-shadow: 0 2px 8px rgba(239, 73, 73, 0.3);
}

.export-btn i {
    font-size: 0.875rem;
}

.accordion-section {
    margin-bottom: 0;
    background-color: white;
    border-radius: 25px;
    overflow: visible;
    border: 1px solid #FDEAEA;
}

.accordion-header {
    background-color: #ffffff;
    padding: 35px 40px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    border-radius: 25px;
    border-bottom: none !important;
}

.accordion-header:hover {
    background-color: #fafafa;
}

.accordion-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #EF4949;
    letter-spacing: -0.01em;
    transition: color 0.2s;
}

.accordion-header.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: #e5e7eb;
}

.accordion-header.active h2 {
    color: #111827;
}

.accordion-icon {
    font-size: 1.125rem;
    color: #6b7280;
    transition: transform 0.2s;
    width: 25px;
    height: 25px;
    display: inline-block;
    transform: rotate(180deg);
}

.accordion-header.active .accordion-icon {
    transform: rotate(0deg);
}

.accordion-content {
    display: none;
    padding: 16px;
    /* border: 1px solid #f3f4f6; */
    border-top: none !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: visible; /* Allows tooltips to overflow on desktop */
}

.accordion-content.active {
    display: block;
}

.services-table-wrapper {
    background-color: white;
    border-radius: 10px;
    overflow: visible; /* Allows tooltips to overflow on desktop */
    border-color: #000 !important;
    box-shadow: 0 1px 3px rgb(0 0 0 / 48%);
}

.services-table {
    width: 100%;
    border-radius: 10px !important;
    border-color: #000 !important;
    background-color: white;
    border-collapse: collapse;
    overflow: visible !important;
}

.services-table thead tr {
    background-color: #EF4949;
}

.services-table thead th {
    color: white;
    padding: 20px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9375rem;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.45;
    vertical-align: top;
}

.services-table thead th:first-child {
    width: 13%;
    padding-left: 24px;
    border-top-left-radius: 10px;
}

.services-table thead th:nth-child(2) {
    width: 17%;
}

.services-table thead th:nth-child(3),
.services-table thead th:nth-child(4),
.services-table thead th:nth-child(5) {
    width: 23.33%;
}

.services-table thead th:last-child {
    border-right: none;
    padding-right: 24px;
    border-top-right-radius: 10px;
}

.services-table thead th small {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    margin-top: 3px;
    opacity: 0.92;
}

.services-table tbody tr {
    border-bottom: 1px solid #b8b8b8;
}

.services-table tbody tr:last-child {
    border-bottom: none;
}

.services-table tbody tr:hover {
    background-color: #fafbfc;
}

.services-table tbody td {
    padding: 20px 18px;
    vertical-align: top;
    border-right: 1px solid #b8b8b8;
    color: #252525;
    font-size: 0.9375rem;
    line-height: 1.55;
    position: relative;
    overflow: visible !important;
}

.services-table tbody td:first-child {
    padding-left: 24px;
}

.services-table tbody td:last-child {
    border-right: none;
    padding-right: 24px;
}

.services-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

.services-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

.services-table tbody td:first-child {
    font-weight: 600;
    color: #111827;
}

.service-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9375rem;
    color: #111827;
}

.service-subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 400;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #000;
    border-radius: 50%;
    font-size: 0.6875rem;
    color: #000;
    cursor: help;
    font-weight: 600;
    font-style: normal;
    position: absolute;
    top: 16px;
    right: 16px;
}

.info-tooltip {
    position: fixed;
    background-color: #EF4949;
    color: white;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
    min-width: 280px;
    max-width: 320px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.info-tooltip::before {
    content: '';
    position: absolute;
    top: 16px;
    left: -6px;
    transform: translateY(0);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent #EF4949 transparent transparent;
}

/* Arrow for last column tooltip */
.services-table tbody td:last-child .info-tooltip::before {
    left: auto;
    right: -6px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #EF4949;
}

.info-icon:hover + .info-tooltip {
    opacity: 1;
    visibility: visible;
}

.services-table tbody td.has-info {
    padding-right: 44px;
}

@media (max-width: 1200px) {
    .managed-services-container {
        padding: 50px 40px;
    }

    .section-header h1 {
        font-size: 2.25rem;
    }
}

/* Hide mobile view on desktop, show table */
.mobile-accordion-view {
    display: none;
}

.desktop-table-view {
    display: block;
}

/* Mobile UI for devices below 840px */
@media (max-width: 840px) {
    /* Hide desktop table, show mobile accordion */
    .desktop-table-view {
        display: none;
    }

    .mobile-accordion-view {
        display: block;
    }

    /* Mobile Service Item Styling */
    .mobile-service-item {
        background: white;
        border: 1px solid #E5E7EB;
        border-radius: 12px;
        margin-bottom: 12px;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .mobile-service-header {
        padding: 16px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .mobile-service-header:active {
        background-color: #F9FAFB;
    }

    .mobile-service-title {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .service-name-mobile {
        font-size: 1rem;
        font-weight: 600;
        color: #111827;
    }

    .service-subtitle-mobile {
        font-size: 0.875rem;
        color: #6B7280;
        font-weight: 400;
    }

    .mobile-service-arrow {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
        transform: rotate(180deg);
        flex-shrink: 0;
    }

    .mobile-service-item.active .mobile-service-arrow {
        transform: rotate(0deg);
    }

    /* Mobile Service Content */
    .mobile-service-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0 20px;
    }

    .mobile-service-item.active .mobile-service-content {
        padding: 0 20px 20px 20px;
    }

    /* Info Rows */
    .mobile-info-row {
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid #F3F4F6;
    }

    .mobile-info-row:last-of-type {
        border-bottom: none;
        margin-bottom: 16px;
    }

    .mobile-info-label {
        font-size: 0.875rem;
        font-weight: 600;
        color: #6B7280;
        margin-bottom: 8px;
    }

    .mobile-label-subtitle {
        font-weight: 400;
        color: #9CA3AF;
    }

    .mobile-info-value {
        font-size: 0.9375rem;
        color: #111827;
        line-height: 1.6;
    }

    /* Two Column Grid for Plans */
    .mobile-plans-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .mobile-top-grid {
        margin-bottom: 16px;
    }

    .mobile-plan-column {
        background: #F9FAFB;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        padding: 16px;
    }

    .mobile-plan-header {
        font-size: 0.875rem;
        font-weight: 600;
        color: #111827;
        margin-bottom: 4px;
    }

    .mobile-plan-subtitle {
        font-size: 0.75rem;
        color: #6B7280;
        margin-bottom: 12px;
    }

    .mobile-plan-description {
        font-size: 0.875rem;
        color: #374151;
        line-height: 1.5;
        position: relative;
        padding-right: 28px;
    }

    .mobile-plan-description-simple {
        font-size: 0.875rem;
        color: #374151;
        line-height: 1.5;
    }

    /* Mobile Info Icon */
    .mobile-info-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        border: 1px solid #111827;
        border-radius: 50%;
        font-size: 0.625rem;
        color: #111827;
        cursor: pointer;
        font-weight: 600;
        font-style: normal;
        position: absolute;
        top: 0;
        right: 0;
        transition: all 0.2s;
    }

    .mobile-info-icon:active {
        background-color: #111827;
        color: white;
    }

    /* Mobile Tooltip - Card with arrow */
    .mobile-info-tooltip {
        position: fixed;
        background-color: #EF4949;
        color: white;
        padding: 16px;
        border-radius: 8px;
        font-size: 0.8125rem;
        line-height: 1.5;
        font-weight: 400;
        width: 280px;
        max-width: calc(100vw - 32px);
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.9);
        transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        pointer-events: none;
        --arrow-left: 50%; /* Default center position */
    }

    .mobile-info-tooltip.show {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
        pointer-events: auto;
    }

    /* Arrow positioning - Top Center (default) */
    .mobile-info-tooltip::before {
        content: '';
        position: absolute;
        width: 0;
        height: 0;
        border-style: solid;
    }

    /* Arrow at top (tooltip below icon) - dynamically positioned */
    .mobile-info-tooltip.arrow-top-center::before,
    .mobile-info-tooltip.arrow-top-left::before,
    .mobile-info-tooltip.arrow-top-right::before {
        top: -8px;
        left: var(--arrow-left);
        transform: translateX(-50%);
        border-width: 0 8px 8px 8px;
        border-color: transparent transparent #EF4949 transparent;
    }

    /* Arrow at bottom (tooltip above icon) - dynamically positioned */
    .mobile-info-tooltip.arrow-bottom-center::before,
    .mobile-info-tooltip.arrow-bottom-left::before,
    .mobile-info-tooltip.arrow-bottom-right::before {
        bottom: -8px;
        left: var(--arrow-left);
        transform: translateX(-50%);
        border-width: 8px 8px 0 8px;
        border-color: #EF4949 transparent transparent transparent;
    }

    /* Hide Details Button */
    .mobile-hide-details {
        width: 100%;
        background: white;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 0.9375rem;
        font-weight: 500;
        color: #EF4949;
    }

    .mobile-hide-details:active {
        background-color: #F9FAFB;
    }

    .mobile-hide-details .details-arrow {
        width: 18px;
        height: 18px;
        transition: transform 0.3s ease;
        transform: rotate(180deg);
        filter: brightness(0) saturate(100%) invert(40%) sepia(97%) saturate(2448%) hue-rotate(340deg) brightness(96%) contrast(92%);
    }

    .mobile-service-item.active .mobile-hide-details .details-arrow {
        transform: rotate(0deg);
    }

    /* Toggle text visibility */
    .mobile-service-item:not(.active) .mobile-hide-details .hide-text {
        display: none;
    }

    .mobile-service-item.active .mobile-hide-details .show-text {
        display: none;
    }

    .mobile-service-item:not(.active) .mobile-hide-details .show-text {
        display: inline;
    }

    .mobile-service-item.active .mobile-hide-details .hide-text {
        display: inline;
    }

    /* Adjust accordion content padding on mobile */
    .accordion-content {
        padding: 12px;
    }

    .accordion-section {
        border-radius: 16px;
    }

    .accordion-header {
        padding: 20px 20px;
        border-radius: 16px;
    }

    .accordion-header h2 {
        font-size: 1.25rem;
    }
}

/* Mobile Tooltip Modal - Hide by default on all screens */
.mobile-tooltip-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

/* Phone-specific adjustments (below 576px) */
@media (max-width: 576px) {
    .managed-services-container {
        padding: 30px 16px;
    }

    /* Stack heading and button vertically on phones */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-header h1 {
        font-size: 1.5rem;
    }

    .export-btn {
        padding: 12px 20px;
        /* Remove width: 100% to let button size naturally */
    }

    /* Single column layout for very small phones */
    .mobile-plans-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mobile-plan-column {
        padding: 14px;
    }

    .mobile-service-header {
        padding: 14px 16px;
    }

    .service-name-mobile {
        font-size: 0.9375rem;
    }

    .accordion-header {
        padding: 16px;
    }

    .accordion-header h2 {
        font-size: 1.125rem;
    }

    /* Enable Mobile Tooltip Modal only for phones */
    .mobile-tooltip-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999999;
        opacity: 0;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(8px);
    }

    .mobile-tooltip-modal.show {
        display: flex !important; /* Override the hide when shown */
        align-items: center;
        justify-content: center;
        opacity: 1;
    }

    .mobile-tooltip-modal-content {
        background-color: white;
        color: #111827;
        padding: 28px 24px;
        border-radius: 20px;
        width: 100%;
        max-width: 320px;
        position: relative;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
        transform: scale(0.9) translateY(20px);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        border-top: 4px solid #EF4949;
    }

    .mobile-tooltip-modal.show .mobile-tooltip-modal-content {
        transform: scale(1) translateY(0);
    }

    .mobile-tooltip-close {
        position: absolute;
        top: 16px;
        right: 16px;
        background: #F3F4F6;
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #6B7280;
        transition: all 0.2s;
        z-index: 10;
    }

    .mobile-tooltip-close:active {
        background: #E5E7EB;
        transform: scale(0.95);
    }

    .mobile-tooltip-close svg {
        width: 18px;
        height: 18px;
    }

    .mobile-tooltip-modal-text {
        font-size: 0.9375rem;
        line-height: 1.7;
        color: #374151;
        text-align: left;
        overflow-y: auto;
        max-height: 60vh;
        padding-right: 8px;
        padding-top: 8px;
    }

    .mobile-tooltip-modal-text::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-tooltip-modal-text::-webkit-scrollbar-thumb {
        background-color: #D1D5DB;
        border-radius: 2px;
    }

    /* Hide tooltip cards on phones, only show modal */
    .mobile-info-tooltip {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .managed-services-container {
        padding: 40px 24px;
    }

    .section-header h1 {
        font-size: 1.875rem;
    }

    .export-btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    .export-btn img {
        width: 20px !important;
        height: 20px !important;
    }

    /* Table styles for tablet range (768px - 840px) */
    .services-table {
        font-size: 0.875rem;
        overflow-x: auto;
    }

    .services-table thead th,
    .services-table tbody td {
        padding: 16px 12px;
    }

    .accordion-header {
        padding: 20px 20px;
    }

    .accordion-header h2 {
        font-size: 1.25rem;
    }
}
