/* Governing Structure Page Styles */

/* Page Header */
.page-header {
    background: linear-gradient(rgba(0, 51, 102, 0.8), rgba(0, 51, 102, 0.9)), url('../images/structure-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-header p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Organogram Section */
.organogram-section {
    background-color: var(--light-gray);
    padding: 60px 0;
}

.organogram-container {
    overflow: auto;
    padding: 30px 0;
    margin: 0 auto;
}

.organogram {
    min-width: 1200px;
    position: relative;
    margin: 0 auto;
    height: 900px;
}

/* Levels */
.level {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 80px;
}

/* Node Styles */
.node {
    background-color: var(--white);
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    text-align: center;
    min-width: 180px;
    position: relative;
    border-top: 4px solid var(--primary-blue);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 10;
}

.node:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.main-node {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    font-weight: bold;
    min-width: 220px;
}

.node h3 {
    color: var(--accent-red);
    font-size: 1rem;
    margin: 0;
}

.main-node h3 {
    color: var(--white);
}

/* Specific Level Positioning */
.synod-level {
    margin-bottom: 60px;
}

.synod-level .node {
    background: var(--primary-blue);
    color: white;
    min-width: 250px;
}

.executive-level {
    width: 80%;
    margin: 0 auto 60px auto;
    justify-content: space-between;
    position: relative;
}

.executive-level .node {
    flex: 1;
    margin: 0 15px;
    position: relative;
}

.executive-level .main-node {
    background: var(--secondary-blue);
}

.secretary-level {
    margin-bottom: 60px;
}

.secretary-level .node {
    background: var(--accent-red);
    color: white;
}

.secretary-level .node h3 {
    color: white;
}

.dept-level {
    margin-bottom: 80px;
}

.dept-level .node {
    background: #9b59b6;
    color: white;
}

.dept-level .node h3 {
    color: white;
}

.operations-level {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 90%;
    margin: 0 auto 80px auto;
}

.operations-level .node {
    padding: 15px 10px;
    font-size: 14px;
    min-width: 140px;
}

.councils-level {
    position: absolute;
    left: 5%;
    top: 230px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 20%;
}

.councils-level .node {
    background: #e67e22;
    color: white;
    text-align: left;
}

.councils-level .node h3 {
    color: white;
    font-size: 14px;
}

.finance-level {
    position: absolute;
    right: 5%;
    top: 250px;
    display: flex;
    flex-direction: column;
    width: 20%;
}

.finance-level .node {
    background: #27ae60;
    color: white;
    margin-bottom: 80px;
}

.finance-level .node h3 {
    color: white;
}

.finance-level .sub-node {
    background: #2ecc71;
    margin-top: 10px;
}

.community-level {
    margin-top: -40px;
}

.community-level .node {
    background: #34495e;
    color: white;
}

.community-level .node h3 {
    color: white;
}

/* CONNECTING ARROWS */
.connector {
    position: absolute;
    background: var(--primary-blue);
    z-index: 1;
}

/* Vertical connectors between levels */
.vertical-connector {
    width: 2px;
    background: var(--primary-blue);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.synod-to-executive {
    height: 60px;
    top: 100px;
    left: 50%;
}

.executive-to-secretary {
    height: 60px;
    top: 280px;
    left: 50%;
}

.secretary-to-dept {
    height: 60px;
    top: 420px;
    left: 50%;
}

.dept-to-operations {
    height: 60px;
    top: 540px;
    left: 50%;
}

.operations-to-community {
    height: 60px;
    top: 750px;
    left: 50%;
}

/* Horizontal connectors for executive level */
.horizontal-connector {
    height: 2px;
    background: var(--primary-blue);
    top: 50%;
    transform: translateY(-50%);
}

/* Moderator to Executive (left to right) */
.moderator-to-executive {
    width: 35px;
    left: 100%;
}

/* Executive to Treasurer (left to right) */
.executive-to-treasurer {
    width: 20px;
    right: 100%;
}

/* DOWNWARD ARROWS from Moderator to Councils and Treasurer to Finance */
.moderator-to-councils {
    height: 20px;
    width: 2px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-blue);
}

.treasurer-to-finance {
    height: 40px;
    width: 2px;
    top: 100%;
    left: 80%;
    transform: translateX(-50%);
    background: var(--primary-blue);
}

/* Finance to Accounts vertical connector */
.finance-to-accounts {
    height: 80px;
    width: 2px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* Separator line */
.separator-line {
    position: absolute;
    width: 80%;
    height: 2px;
    background: var(--primary-blue);
    top: 720px;
    left: 10%;
    z-index: 1;
}

/* Arrow heads */
.arrow-down::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--primary-blue);
}

.arrow-right::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--primary-blue);
}

.arrow-left::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--primary-blue);
}

/* Executive Team Section */
.executives-section {
    background-color: var(--white);
}

.executives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.executive-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid var(--accent-red);
}

.executive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.executive-photo {
    height: 250px;
    overflow: hidden;
    background-color: var(--light-gray);
}

.executive-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.executive-card:hover .executive-photo img {
    transform: scale(1.05);
}

.executive-info {
    padding: 25px;
    text-align: center;
}

.executive-info h3 {
    color: var(--primary-blue);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.executive-info .title {
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.executive-info .role {
    color: var(--dark-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Roles Section */
.roles-section {
    background-color: var(--light-gray);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.role-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-blue);
    transition: transform 0.3s;
}

.role-card:hover {
    transform: translateY(-5px);
}

.role-card h3 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.role-card ul {
    list-style: none;
    padding-left: 0;
}

.role-card ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    position: relative;
    padding-left: 25px;
}

.role-card ul li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-red);
    font-weight: bold;
    font-size: 1.2rem;
}

.role-card ul li:last-child {
    border-bottom: none;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .page-header {
        padding: 60px 0;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .page-header p {
        font-size: 1.1rem;
    }

    /* Organogram Mobile - PRESERVE EXACT STRUCTURE */
    .organogram-container {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 0;
        border: 1px solid var(--light-gray);
        border-radius: 8px;
        background: var(--white);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }
    
    .organogram-container:active {
        cursor: grabbing;
    }
    
    .organogram {
        min-width: 1200px;
        height: 900px;
        margin: 0 auto;
    }

    /* Keep all original positioning and connectors */
    .level {
        margin-bottom: 80px;
    }

    .node {
        min-width: 180px;
        padding: 20px 24px;
    }

    .main-node {
        min-width: 220px;
    }

    .node h3 {
        font-size: 1rem;
    }

    /* Preserve all absolute positioning */
    .councils-level,
    .finance-level {
        position: absolute;
    }

    .councils-level {
        left: 5%;
        top: 230px;
        width: 20%;
    }

    .finance-level {
        right: 5%;
        top: 250px;
        width: 20%;
    }

    /* Keep all connectors visible */
    .connector,
    .vertical-connector,
    .horizontal-connector,
    .moderator-to-executive,
    .executive-to-treasurer,
    .moderator-to-councils,
    .treasurer-to-finance,
    .finance-to-accounts,
    .separator-line,
    .arrow-down::after,
    .arrow-right::after,
    .arrow-left::after {
        display: block !important;
    }

    /* Improve scrollbar visibility */
    .organogram-container::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }
    
    .organogram-container::-webkit-scrollbar-thumb {
        background: var(--primary-blue);
        border-radius: 4px;
    }
    
    .organogram-container::-webkit-scrollbar-track {
        background: var(--light-gray);
        border-radius: 4px;
    }

    /* Executive Team Mobile Styles */
    .executives-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .executive-card {
        margin: 0 10px;
    }
    
    .executive-photo {
        height: 200px;
    }
    
    .executive-info {
        padding: 20px;
    }
    
    /* Roles Section Mobile */
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .role-card {
        padding: 20px;
        margin: 0 10px;
    }
    
    .role-card h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }

    /* Organogram for very small screens - STILL PRESERVE STRUCTURE */
    .organogram-container {
        padding: 15px 0;
    }
    
    .organogram {
        min-width: 1200px;
        height: 900px;
    }

    /* Keep all original measurements */
    .node {
        min-width: 180px;
        padding: 20px 24px;
    }

    .main-node {
        min-width: 220px;
    }

    .node h3 {
        font-size: 1rem;
    }

    /* Executive Team */
    .executives-grid {
        grid-template-columns: 1fr;
    }
    
    .executive-photo {
        height: 180px;
    }
    
    .executive-info h3 {
        font-size: 1.2rem;
    }
    
    .role-card {
        padding: 15px;
    }
}

/* Add instructional text for mobile users */
@media (max-width: 768px) {
    .organogram-section .container::after {
        content: "💡 Tip: Scroll horizontally and vertically to view the complete organizational structure";
        display: block;
        text-align: center;
        margin-top: 15px;
        font-size: 0.9rem;
        color: var(--dark-gray);
        font-style: italic;
        padding: 10px;
        background: var(--light-gray);
        border-radius: 5px;
    }
}

/* Ensure text remains readable on all devices */
@media (max-width: 480px) {
    .executive-info .title {
        font-size: 1rem;
    }
    
    .executive-info .role {
        font-size: 0.9rem;
    }
}