/* Premium Department details pages styling */

.dept-detail-section {
    background-color: #f8fafc;
}

/* Glassmorphic card container for details */
.dept-detail-card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(13, 31, 45, 0.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}

/* History text blocks */
.dept-content-text {
    font-size: 15px;
    color: #475569;
    line-height: 1.8;
}

.dept-content-text p {
    margin-bottom: 20px;
}

/* Styled office cover image */
.dept-cover-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dept-cover-img {
    transition: transform 0.4s ease;
}

.dept-cover-wrap:hover .dept-cover-img {
    transform: scale(1.03);
}

/* Bottom action buttons spacing on mobile viewports */
.bottom-action-buttons {
    width: 100%;
}

.bottom-action-buttons a {
    margin-bottom: 12px;
    width: 100%;
}

@media (min-width: 576px) {
    .bottom-action-buttons {
        flex-direction: row !important;
    }
    .bottom-action-buttons a {
        margin-bottom: 0;
        width: auto;
    }
}

/* Premium Flow Chart / Timeline Styles */
.timeline-flow-container {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px 0;
}

/* Central vertical line */
.timeline-flow-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 31px; /* Center on Year bubble for mobile */
    width: 3px;
    background: linear-gradient(180deg, #1964a2 0%, rgba(25, 100, 162, 0.1) 100%);
    border-radius: 2px;
}

@media (min-width: 768px) {
    .timeline-flow-container::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-flow-item {
    position: relative;
    margin-bottom: 50px;
    width: 100%;
}

.timeline-flow-item:last-child {
    margin-bottom: 0;
}

/* Timeline dot/bubble containing year */
.timeline-year-bubble {
    position: absolute;
    top: 0;
    left: 10px;
    width: 45px;
    height: 45px;
    background-color: #1964a2;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    z-index: 5;
    box-shadow: 0 0 0 4px #ffffff, 0 4px 10px rgba(25, 100, 162, 0.25);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .timeline-year-bubble {
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 60px;
        font-size: 14px;
        box-shadow: 0 0 0 6px #ffffff, 0 4px 15px rgba(25, 100, 162, 0.25);
    }
}

.timeline-flow-item:hover .timeline-year-bubble {
    background-color: #0d1f2d;
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .timeline-flow-item:hover .timeline-year-bubble {
        transform: translateX(-50%) scale(1.1);
    }
}

/* Timeline content card */
.timeline-content-card {
    position: relative;
    margin-left: 75px;
    background: #ffffff;
    border: 1px solid rgba(13, 31, 45, 0.05);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-content-card::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -15px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

@media (min-width: 768px) {
    .timeline-content-card {
        width: 42%;
        margin-left: 0;
    }
    
    /* Alternating layout left/right */
    .timeline-flow-item-left .timeline-content-card {
        float: left;
    }
    
    .timeline-flow-item-left .timeline-content-card::before {
        left: auto;
        right: -15px;
        border-color: transparent transparent transparent #ffffff;
    }
    
    .timeline-flow-item-right .timeline-content-card {
        float: right;
    }
}

.timeline-flow-item:hover .timeline-content-card {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(13, 31, 45, 0.08);
    border-color: #1964a2;
}

.timeline-content-card p {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.timeline-clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Vision/Mission Icons wrapper */
.vision-icon-wrap {
    width: 70px;
    height: 70px;
    background-color: rgba(25, 100, 162, 0.08);
    color: #1964a2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s ease;
}

.dept-detail-card:hover .vision-icon-wrap {
    background-color: #1964a2;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(25, 100, 162, 0.25);
}

/* Premium Team Directory Styles */
.team-member-card {
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(13, 31, 45, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-member-photo-wrap {
    position: relative;
    height: 280px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.team-member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-member-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(13, 31, 45, 0.1);
    border-color: rgba(25, 100, 162, 0.15);
}

.team-member-card:hover .team-member-photo {
    transform: scale(1.06);
}

.team-member-info {
    padding: 24px 20px;
    text-align: center;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.team-member-name {
    font-size: 16px;
    font-weight: 700;
    color: #0d1f2d;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.team-member-card:hover .team-member-name {
    color: #1964a2;
}

.team-member-position {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    display: inline-block;
    background-color: #f8fafc;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Premium Organogram tree styles */
.org-chart-wrapper {
    overflow-x: auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(13, 31, 45, 0.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}

.org-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.org-tree ul {
    list-style: none;
    padding-left: 30px;
    border-left: 2px solid rgba(25, 100, 162, 0.15) !important;
    margin-top: 15px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.org-node {
    margin-bottom: 20px;
    position: relative;
}

.org-node::before {
    content: "";
    position: absolute;
    top: 25px;
    left: -32px;
    width: 30px;
    border-top: 2px solid rgba(25, 100, 162, 0.15) !important;
}

.org-tree > .org-node::before {
    display: none !important;
}

/* Card Styling */
.org-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 5px solid #64748b !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    display: inline-block !important;
    min-width: 280px !important;
    max-width: 100% !important;
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.org-card:hover {
    transform: translateX(6px) !important;
    box-shadow: 0 8px 24px rgba(13, 31, 45, 0.08) !important;
}

/* Dynamic colors based on hierarchy levels */
.org-node.level-0 > .org-card {
    border-left-color: #1964a2 !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(25, 100, 162, 0.03) 100%) !important;
}

.org-node.level-0 > .org-card .org-role {
    font-size: 16px !important;
    color: #1964a2 !important;
}

.org-node.level-1 > .org-card {
    border-left-color: #4b8a24 !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(75, 138, 36, 0.03) 100%) !important;
}

.org-node.level-1 > .org-card .org-role {
    color: #4b8a24 !important;
}

.org-node.level-2 > .org-card {
    border-left-color: #ff9800 !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 152, 0, 0.03) 100%) !important;
}

.org-node.level-2 > .org-card .org-role {
    color: #ff9800 !important;
}

/* Text styles */
.org-role {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    padding-right: 35px !important;
}

.org-name {
    font-size: 13px !important;
    color: #475569 !important;
    font-weight: 600 !important;
}

/* Toggle chevron button */
.org-toggle-btn {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
    border: 1px solid #e2e8f0 !important;
}

.org-card:hover .org-toggle-btn {
    background-color: #1964a2 !important;
    color: #ffffff !important;
    border-color: #1964a2 !important;
}

.org-toggle-btn::after {
    content: '\f078' !important; /* FontAwesome Chevron Down */
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
    font-size: 11px !important;
    transition: transform 0.3s ease !important;
}

.org-node.collapsed .org-toggle-btn::after {
    transform: rotate(-90deg) !important;
}

.org-node.collapsed > ul {
    display: none !important;
}

/* Responsive Organogram Overrides */
@media (max-width: 768px) {
    .org-chart-wrapper {
        padding: 15px !important;
        overflow-x: visible !important; /* No horizontal scrollbar needed */
    }
    
    .org-tree {
        display: block !important;
        min-width: unset !important;
    }
    
    .org-tree ul {
        padding-left: 15px !important; /* Minimal indent to preserve layout space */
        border-left: 2px solid rgba(25, 100, 162, 0.1) !important;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .org-node {
        margin-bottom: 12px;
    }
    
    .org-node::before {
        left: -17px !important;
        width: 15px !important;
        border-top: 2px solid rgba(25, 100, 162, 0.1) !important;
    }
    
    .org-card {
        min-width: unset !important;
        width: 100% !important; /* Stretch card to take full container width */
        max-width: 100% !important;
        padding: 12px 14px !important;
        display: block !important;
    }
    
    .org-role {
        font-size: 12px !important;
        padding-right: 30px !important;
    }
    
    .org-name {
        font-size: 11px !important;
    }
    
    .org-toggle-btn {
        width: 24px !important;
        height: 24px !important;
        right: 12px !important;
    }
}

/* =====================================================
   Legal Framework — Document Card Grid
   ===================================================== */

/* Document card */

.doc-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e8eef4;
    box-shadow: 0 2px 12px rgba(13, 31, 45, 0.06);
    padding: 28px 28px 22px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Blue gradient top accent stripe */
.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1964a2, #2a85d0);
    border-radius: 16px 16px 0 0;
}

.doc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(13, 31, 45, 0.12);
    border-color: rgba(25, 100, 162, 0.2);
}

/* Numbered badge (top-right) */
.doc-card-num {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(25, 100, 162, 0.08);
    color: #1964a2;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PDF icon tile */
.doc-card-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #dc2626;
    margin-bottom: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.doc-card:hover .doc-card-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.doc-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0d1f2d;
    margin-bottom: 10px;
    line-height: 1.4;
    padding-right: 30px;
}

.doc-card-desc {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.65;
    flex-grow: 1;
    margin-bottom: 20px;
}

.doc-card-desc p {
    margin: 0;
}

.doc-card-divider {
    height: 1px;
    background: #f1f5f9;
    margin-bottom: 18px;
}

/* Gradient pill download button */
.doc-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #1964a2, #2a85d0);
    color: #ffffff !important;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(25, 100, 162, 0.25);
}

.doc-dl-btn:hover {
    background: linear-gradient(135deg, #0d3d6e, #1964a2);
    box-shadow: 0 6px 18px rgba(25, 100, 162, 0.35);
    color: #ffffff !important;
    transform: translateX(3px);
}

/* Navigation button row */
.lf-nav-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 40px;
}

.lf-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    text-decoration: none !important;
}

.lf-nav-btn.btn-secondary-outline {
    border: 2px solid #cbd5e1;
    color: #475569 !important;
    background: #ffffff;
}

.lf-nav-btn.btn-secondary-outline:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0d1f2d !important;
}

.lf-nav-btn.btn-primary-outline {
    border: 2px solid #1964a2;
    color: #1964a2 !important;
    background: #ffffff;
}

.lf-nav-btn.btn-primary-outline:hover {
    background: #1964a2;
    color: #ffffff !important;
}

/* Mobile: stack buttons full-width */
@media (max-width: 576px) {
    .lf-nav-btns {
        flex-direction: column;
    }
    .lf-nav-btn,
    .doc-dl-btn {
        justify-content: center;
        width: 100%;
        align-self: stretch;
    }
}

/* =====================================================
   Contact Us — Office Cards
   ===================================================== */

/* Office card */
.office-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e8eef4;
    box-shadow: 0 4px 20px rgba(13, 31, 45, 0.06);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.office-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(13, 31, 45, 0.12);
    border-color: rgba(25, 100, 162, 0.2);
}

/* 16:9 responsive map embed */
.office-map-wrap {
    position: relative;
    width: 100%;
    padding-top: 56%;
    background: #e8eef4;
    overflow: hidden;
}

.office-map-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Normalize inline styles from DB-stored HTML in address field */
.office-info-value,
.office-info-value * {
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #334155 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Card body */
.office-card-body {
    padding: 24px 24px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Office name header bar */
.office-name-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.office-name-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1964a2, #2a85d0);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.office-name-text {
    font-size: 16px;
    font-weight: 800;
    color: #0d1f2d;
    line-height: 1.3;
}

/* Info rows (address, phone) */
.office-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.office-info-row:last-of-type {
    margin-bottom: 0;
}

.office-info-icon {
    width: 36px;
    height: 36px;
    background: rgba(25, 100, 162, 0.07);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #1964a2;
    flex-shrink: 0;
    margin-top: 2px;
}

.office-info-content {
    flex: 1;
}

.office-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    margin-bottom: 2px;
}

/* Open in Maps button */
.office-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: transparent;
    border: 2px solid #1964a2;
    border-radius: 12px;
    color: #1964a2;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.office-map-btn:hover {
    background: #1964a2;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(25, 100, 162, 0.3);
}
