@font-face {
    font-family: 'IBMPlexSansArabic';
    src: url('https://static.moh.gov.sa/assets/Enterprise/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IBMPlexSansArabic';
    src: url('https://static.moh.gov.sa/assets/Enterprise/fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

:root {
    --struc-moh-green: #1b8354;
    --struc-moh-green-light: #28a745;
    --struc-text-main: #161616;
    --struc-text-muted: #6c757d;
    --struc-border-color: #e0e4e8;
    --struc-bg-color: #f0f4f8;
    --struc-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --struc-shadow-lg: 0 15px 30px rgba(27, 131, 84, 0.15);
}



#struc-chart-container {
    width: 100%;
    height: 100%;
}

/* -------------------------------------
   PREMIUM D3-ORG-CHART NODE CSS
-------------------------------------- */
.struc-org-node {
    background: white;
    border: 1px solid var(--struc-border-color);
    border-radius: 12px;
    box-shadow: var(--struc-shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.struc-org-node:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--struc-shadow-lg);
    border-color: var(--struc-moh-green-light);
}



.struc-org-node-content {
    padding: 20px 15px 15px 15px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.struc-org-node-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    color: var(--struc-text-main);
    margin-bottom: 8px;
}

.struc-org-node-subtitle {
    font-weight: 600;
    font-size: 11px;
    color: var(--struc-moh-green);
    background: rgba(27, 131, 84, 0.1);
    padding: 3px 8px;
    border-radius: 15px;
    display: inline-block;
    align-self: flex-start;
}

.struc-org-node-count {
    margin-top: 12px;
    font-size: 11px;
    color: var(--struc-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Node specific styling based on type */
.struc-org-node.struc-type-minister { border: 2px solid var(--struc-moh-green); }

/* Expanded Node Styling */
.struc-org-node.struc-is-expanded {
    border-color: var(--struc-moh-green);
    box-shadow: 0 4px 15px rgba(0, 90, 50, 0.15);
}
.struc-org-node.struc-is-expanded .struc-org-expand-btn {
    background: var(--struc-moh-green);
    color: white;
    border-color: var(--struc-moh-green);
}

/* Expand button (now inside d3 buttonContent) */
.struc-node-button-g {
    z-index: 1000;
}



/* Sidebar */
.struc-info-sidebar {
    position: absolute;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: white;
    border-left: 1px solid var(--struc-border-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    transition: right 0.3s ease;
    z-index: 100;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.struc-info-sidebar.open {
    right: 0;
}

.struc-close-sidebar-btn {
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--struc-text-muted);
    cursor: pointer;
    margin-bottom: 20px;
    padding: 0;
}

.struc-close-sidebar-btn:hover {
    color: var(--struc-moh-green);
}

.struc-sidebar-header {
    text-align: center;
    margin-bottom: 30px;
}

.struc-sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f8faf9;
    border: 2px solid var(--struc-moh-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--struc-moh-green);
    margin: 0 auto 15px;
}

.struc-sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--struc-moh-green);
    margin-bottom: 5px;
}

.struc-sidebar-header p {
    font-size: 13px;
    color: var(--struc-text-muted);
    margin: 0;
}

.struc-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.struc-info-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.struc-info-item i {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 90, 50, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--struc-moh-green);
    font-size: 18px;
}

.struc-info-item label {
    font-size: 12px;
    color: var(--struc-text-muted);
    margin-bottom: 2px;
    display: block;
}

.struc-info-item div > div {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.struc-org-expand-btn {
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid var(--struc-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--struc-moh-green);
    font-size: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    margin: 0 auto;
}

.struc-org-expand-btn:hover {
    background: var(--struc-moh-green);
    color: white;
    border-color: var(--struc-moh-green);
    transform: scale(1.1);
}

.struc-is-expanded-btn {
    background: var(--struc-moh-green);
    color: white;
    border-color: var(--struc-moh-green);
}

.struc-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

/* Custom Structure Buttons (Replaces Bootstrap btn) */
.struc-btn {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.struc-btn-light {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

.struc-btn-light:hover {
    color: #212529;
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

.struc-shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

/* Control Buttons Icons */
.struc-btn-light i.fa-solid {
    color: var(--struc-moh-green);
}
