/* About Us Page Custom Styles */

/* ============================================
   SCOPED OVERRIDES: About Page Editor Modal
   Force light sidebar regardless of dark theme
   ============================================ */
#aboutEditorModal .edit-package-modal {
    background-color: #ffffff;
    color: #333;
}

#aboutEditorModal .pkg-modal-sidebar {
    background-color: #f8f9fa !important;
    border-right: 1px solid #e0e0e0 !important;
}

#aboutEditorModal .pkg-modal-main {
    background-color: #ffffff;
    color: #333;
}

/* Inactive tab — clearly readable on the light sidebar */
#aboutEditorModal .about-tab {
    background-color: #ffffff !important;
    color: #555 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    border: 1px solid #e0e0e0 !important;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

/* Hover state */
#aboutEditorModal .about-tab:hover {
    background-color: #e8f5e9 !important;
    color: #1e7e34 !important;
    border-color: #a5d6a7 !important;
}

/* Active tab — solid green, clearly selected */
#aboutEditorModal .about-tab.active {
    background-color: #28a745 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-color: #28a745 !important;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4) !important;
}

.about-page-container {
    max-width: 1200px;
    margin: 120px auto 60px auto;
    padding: 0 20px;
    font-family: 'Poppins', Arial, sans-serif;
}

/* Edit Mode Trigger Button */
.edit-page-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.edit-page-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

/* Company Intro / Hero Card */
.company-intro-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin-bottom: 50px;
    display: flex;
    gap: 40px;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 900px) {
    .company-intro-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
}

.company-info-text {
    flex: 1.2;
}

.company-info-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.2;
}

.company-info-text p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

.company-info-image {
    flex: 0.8;
    max-width: 100%;
    min-width: 300px;
    display: flex;
    justify-content: center;
}

.company-info-image img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 3px solid #fff;
    outline: 1px solid #ddd;
}

.company-info-image .placeholder-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1.1rem;
    flex-direction: column;
    gap: 10px;
}

/* Team Grid Styles */
.team-section {
    margin-top: 60px;
}

.team-section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    position: relative;
}

.team-section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #28a745;
    margin: 10px auto 0 auto;
    border-radius: 2px;
}

.team-section-subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 40px;
    font-size: 1.05rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.team-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.team-photo-container {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-photo-placeholder {
    font-size: 2.5rem;
    color: #adb5bd;
}

.team-card h3 {
    font-size: 1.3rem;
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 6px;
}

.team-card .position {
    font-size: 0.95rem;
    color: #28a745;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modals & Forms Styling */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.modal-tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    text-align: center;
}

.modal-tab-btn.active {
    color: #28a745;
    border-bottom-color: #28a745;
}

.about-form-group {
    margin-bottom: 18px;
}

.about-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 8px;
}

.about-form-group input[type="text"],
.about-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.about-form-group input[type="text"]:focus,
.about-form-group textarea:focus {
    border-color: #28a745;
}

/* Team management layout inside modal */
.modal-team-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
    margin-bottom: 20px;
}

.modal-team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.modal-team-item:last-child {
    margin-bottom: 0;
}

.modal-team-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-team-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.modal-team-actions {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-edit {
    background-color: #ffc107;
    color: #212529;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-add-new {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ==============================================
   ORGANIZATION CHART TREE
   ============================================== */
.org-chart-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 40px auto;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 30px;
}

/* Each row of cards at the same level */
.org-level {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    position: relative;
    width: 100%;
    padding: 0 20px;
}

/* Individual card wrapper handles sibling connections */
.org-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 20px 15px 0 15px; /* space for horizontal bar */
    min-width: 200px;
}

/* Sibling horizontal line segments */
.org-node::before,
.org-node::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 2px;
    background-color: #28a745;
}
.org-node::before {
    right: 50%;
}
.org-node::after {
    left: 50%;
}

/* Hide horizontal segments on ends */
.org-node:first-child::before {
    display: none !important;
}
.org-node:last-child::after {
    display: none !important;
}

/* Single child in a level — hide both horizontal segments */
.org-node:only-child::before,
.org-node:only-child::after {
    display: none !important;
}

/* Hide top lines for top level */
.org-level-1 .org-node::before,
.org-level-1 .org-node::after {
    display: none !important;
}

/* Vertical line going down from horizontal bar to the card */
.org-node-card-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #28a745;
}

/* Hide top card-line for top level */
.org-level-1 .org-node-card-line {
    display: none !important;
}

/* Vertical line BELOW the level row (goes down to next level) */
.org-level-connector {
    width: 2px;
    height: 30px;
    background-color: #28a745;
    flex-shrink: 0;
    margin-top: 20px; /* pushes start of connector below the horizontal bar */
}

/* ==============================================
   CARD SIZING PER LEVEL
   ============================================== */

/* Level 1 — largest, most prominent */
.org-level-1 .team-card {
    border: 2px solid #28a745;
    min-width: 200px;
    max-width: 220px;
}

.org-level-1 .team-photo-container {
    width: 120px;
    height: 120px;
}

/* Level 2 — slightly smaller */
.org-level-2 .team-card {
    min-width: 175px;
    max-width: 195px;
}

.org-level-2 .team-photo-container {
    width: 100px;
    height: 100px;
}

/* Level 3+ — compact */
.org-level-3 .team-card,
.org-level-4 .team-card,
.org-level-5 .team-card {
    min-width: 150px;
    max-width: 170px;
    padding: 20px 12px;
}

.org-level-3 .team-photo-container,
.org-level-4 .team-photo-container,
.org-level-5 .team-photo-container {
    width: 80px;
    height: 80px;
}

.org-level-3 .team-card h3,
.org-level-4 .team-card h3,
.org-level-5 .team-card h3 {
    font-size: 1rem;
}

.org-level-3 .team-card .position,
.org-level-4 .team-card .position,
.org-level-5 .team-card .position {
    font-size: 0.8rem;
}

/* Symmetric bottom connector system */
.org-node-bottom-line {
    position: absolute;
    bottom: -20px; /* aligns perfectly to bottom of node card margin */
    left: 0;
    right: 0;
    height: 20px;
    z-index: 1;
}

.org-node-bottom-line-vertical {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #28a745;
}

.org-node-bottom-line-horizontal-left,
.org-node-bottom-line-horizontal-right {
    position: absolute;
    bottom: 0;
    height: 2px;
    background-color: #28a745;
}

.org-node-bottom-line-horizontal-left {
    left: -2px;
    right: 50%;
}

.org-node-bottom-line-horizontal-right {
    left: 50%;
    right: -2px;
}

/* Hide outer horizontal edges on bottom connector */
.org-node:first-child .org-node-bottom-line-horizontal-left {
    display: none !important;
}

.org-node:last-child .org-node-bottom-line-horizontal-right {
    display: none !important;
}

/* Hide both horizontal lines for only-child node */
.org-node:only-child .org-node-bottom-line-horizontal-left,
.org-node:only-child .org-node-bottom-line-horizontal-right {
    display: none !important;
}


