/* ============================================
   SDK Hub Domain Table Specific Styles
   
   Color Scheme (FPT Navy):
   - Primary: #034EA2 (FPT navy blue)
   - Primary Dark: #01297A (FPT dark navy)
   - Light backgrounds: #e6eef7, #f0f4f9
   - Light borders: #d4dce8, #dfe4ed
   
   Typography:
   - Font Family: 'Inter' (from base.css)
   - Font Sizes: 11px-24px
   - Font Weights: 400, 500, 600, 700
   ============================================ */

.page-container { 
    max-width: 100%; 
    margin: 0; 
    padding: 24px 32px; 
}

.sdk-level-path {
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
}

.sdk-hub-domain-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    table-layout: auto;
}

.sdk-hub-domain-table thead th {
    background: #fafafa;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.sdk-hub-domain-table tbody tr.domain-row {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.sdk-hub-domain-table tbody tr.domain-row:hover {
    background: #fafafa;
}

.sdk-hub-domain-table tbody tr.domain-row.expanded {
    background: #f0f4f9;
    border-bottom: none;
}

.sdk-hub-domain-table tbody tr.domain-row td {
    padding: 16px;
    vertical-align: middle;
}

.sdk-hub-domain-table tbody tr.domain-row td:first-child {
    text-align: center;
    padding: 16px 8px;
}

.domain-expand-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    opacity: 0.6;
    transition: transform 0.3s ease, color 0.2s, opacity 0.2s;
}

.domain-expand-btn:hover {
    opacity: 1;
    color: #034EA2;
}

.domain-expand-btn.expanded {
    color: #034EA2;
    opacity: 1;
    transform: rotate(90deg);
}

.domain-expand-btn i {
    font-size: 14px;
}

.domain-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.domain-name-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.domain-name-text strong {
    font-size: 16px;
    font-weight: 600;
    color: #01297A;
    margin-bottom: 6px;
}

.domain-name-text a {
    color: #034EA2;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.domain-name-text a:hover {
    text-decoration: underline;
}

.service-list-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-list-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.service-list-item-compact .service-label {
    color: #333;
    font-weight: 400;
}

.service-list-item-compact.webpush .service-label {
    color: #034EA2;
    font-weight: 500;
}

.service-list-item-compact.game .service-label {
    color: #034EA2;
    font-weight: 400;
    font-style: italic;
}

/* Service Badges */
.service-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-webpush {
    background: #e6f0ff;
    color: #034EA2;
    border: 1px solid #b3d0ff;
}

.badge-gamification {
    background: #f3e8ff;
    color: #722ed1;
    border: 1px solid #d3a8f5;
}

/* Services Toggle Container - Inline Services with Toggles */
.services-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}

.service-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 6px;
    transition: all 0.2s;
}

.service-toggle-item-compact {
    justify-content: flex-start;
    padding: 4px 6px;
}

.service-toggle-item:hover {
    background: #f0f4f9;
    border-color: #d4dce8;
}

.service-toggle-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.service-toggle-info i {
    font-size: 16px;
    flex-shrink: 0;
}

.service-toggle-info > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-toggle-name {
    font-size: 13px;
    font-weight: 500;
    color: #034EA2;
    line-height: 1.3;
}

.service-toggle-id {
    font-size: 11px;
    color: #999;
}

.service-toggle-item .sdk-toggle-switch {
    flex-shrink: 0;
}

.service-toggle-item-grouped {
    align-items: center;
}

.service-inline-toggles {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.inline-toggle-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 4px;
    border-radius: 999px;
    border: 1px solid #d8e3f3;
    background: #f6f9ff;
}

.inline-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    color: #1f7a1f;
    background: rgba(34, 197, 94, 0.14);
}

.service-state-connected {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(34, 197, 94, 0.08);
}

.service-state-connected .sdk-toggle-slider {
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.service-toggle-item-compact .sdk-toggle-switch {
    width: 30px;
    height: 18px;
}

.service-toggle-item-compact .sdk-toggle-slider {
    border-radius: 18px;
}

.service-toggle-item-compact .sdk-toggle-slider:before {
    width: 12px;
    height: 12px;
    left: 3px;
    bottom: 3px;
}

.service-toggle-item-compact .sdk-toggle-switch input:checked + .sdk-toggle-slider:before {
    transform: translateX(12px);
}

@media (max-width: 768px) {
    .sdk-level-path {
        font-size: 12px;
        line-height: 1.5;
    }

    .service-inline-toggles {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Actions Dropdown Menu */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

.actions-dropdown-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.actions-dropdown-btn:hover {
    border-color: #034EA2;
    color: #034EA2;
    background: #f0f4f9;
}

.actions-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 100;
    display: none;
}

.actions-dropdown.open .actions-dropdown-menu {
    display: block;
}

.actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.actions-dropdown-item:last-child {
    border-bottom: none;
}

.actions-dropdown-item:hover {
    background: #f0f4f9;
}

.actions-dropdown-item i {
    font-size: 14px;
    color: #666;
    width: 16px;
    text-align: center;
}

.domain-date {
    color: #666;
    font-size: 13px;
}

.domain-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    border-color: #034EA2;
    color: #034EA2;
    background: #e6eef7;
}

.btn-icon-only.btn-primary {
    background: #034EA2;
    color: #fff;
    border-color: #034EA2;
}

.btn-icon-only.btn-primary:hover {
    background: #01297A;
}

.service-inner-table .btn-icon-only {
    width: 28px;
    height: 28px;
}

.service-inner-table .btn-icon-only i {
    font-size: 12px;
}

/* Expanded Service Row */
.sdk-hub-domain-table tbody tr.service-expand-row {
    background: #f0f4f9;
    border-bottom: 1px solid #dfe4ed;
}

.sdk-hub-domain-table tbody tr.service-expand-row td {
    padding: 0;
}

.service-expand-content {
    padding: 16px 24px 16px 48px;
    border-left: 3px solid #034EA2;
    margin-left: 20px;
    background: #fafbfc;
    border-radius: 0 0 8px 0;
}

.service-inner-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d4dce8;
    table-layout: fixed;
}

.service-inner-table thead th {
    background: #fafbfc;
    color: #666;
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
}

.service-inner-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
}

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

.service-inner-table tbody tr:hover {
    background: #fafbfc;
}

.service-inner-table tbody td {
    padding: 12px;
    vertical-align: middle;
    font-size: 13px;
    color: #333;
}

.service-inner-table tbody tr td:first-child {
    padding-left: 16px;
    white-space: nowrap;
    text-align: center;
    min-width: 70px;
    width: 70px;
    overflow: hidden;
}

.service-inner-table tbody tr td:last-child {
    padding-right: 16px;
}

.sdk-toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.sdk-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sdk-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.sdk-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.sdk-toggle-switch input:checked + .sdk-toggle-slider {
    background-color: #034EA2;
}

.sdk-toggle-switch input:checked + .sdk-toggle-slider:before {
    transform: translateX(16px);
}

.service-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-name-cell i.service-icon {
    font-size: 16px;
}

.service-name-cell i.webpush-icon {
    color: #034EA2;
}

.service-name-cell i.game-icon {
    color: #034EA2;
}

.service-name-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-name-text .name {
    font-weight: 500;
    color: #181D27;
}

.service-name-text .id {
    font-size: 11px;
    color: #999;
}

.sdk-creator-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #034EA2, #01297A);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.ns-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.ns-status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-connected {
    background: #f6ffed;
    color: #52c41a;
}

.status-connected::before {
    background: #52c41a;
}

.status-pending {
    background: #fff7e6;
    color: #faad14;
}

.status-pending::before {
    background: #faad14;
}

.tabs { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 24px; 
    background: #fff; 
    padding: 12px; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.tab { 
    padding: 10px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 500; 
    transition: all 0.2s; 
    border: none; 
    background: transparent; 
    color: #666; 
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab.active { 
    background: #034EA2; 
    color: #fff; 
}

.tab:hover:not(.active) { 
    background: #f0f0f0; 
}

.empty-state { 
    text-align: center; 
    padding: 48px; 
    color: #999; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.empty-state i { 
    font-size: 64px; 
    margin-bottom: 16px; 
    opacity: 0.3; 
}

/* Modal Styles */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0,0,0,0.5); 
    z-index: 1000; 
    align-items: center; 
    justify-content: center; 
}

.modal.show { 
    display: flex; 
}

.modal-content { 
    background: #fff; 
    border-radius: 8px; 
    width: 90%; 
    max-width: 600px; 
    max-height: 80vh; 
    overflow: auto; 
}

.modal-header { 
    padding: 20px 24px; 
    border-bottom: 1px solid #e8e8e8; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.modal-title { 
    font-size: 18px; 
    font-weight: 600; 
}

.modal-close { 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: #999; 
}

.modal-body { 
    padding: 24px; 
}

.code-preview { 
    background: #f5f5f5; 
    border-radius: 6px; 
    padding: 16px; 
    font-family: 'Courier New', monospace; 
    font-size: 13px; 
    overflow-x: auto; 
    margin: 16px 0; 
    border: 1px solid #e8e8e8; 
}

.service-list { 
    margin: 16px 0; 
}

.service-list-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 0; 
}

.domain-name-cell.sticky-col {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 2;
    padding-left: 16px;
}

.domain-row.expanded .domain-name-cell.sticky-col {
    background: #f0f4f9;
}

.sdk-hub-domain-table tbody tr.domain-row:hover .domain-name-cell.sticky-col {
    background: #fafafa;
}

.sdk-hub-domain-table tbody tr.domain-row.expanded:hover .domain-name-cell.sticky-col {
    background: #f0f4f9;
}

.service-expand-row .service-inner-table td:first-child {
    background: #fff;
}

.service-inner-table tbody tr:hover td:first-child {
    background: #fafbfc;
}

.domain-actions-inline {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.domain-actions-inline .btn-icon-only {
    width: 28px;
    height: 28px;
}

.domain-actions-inline .btn-icon-only i {
    font-size: 12px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sdk-board-date {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.sdk-hub-board-child-row td {
    padding: 12px 16px !important;
}
