* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo {
    height: 50px;
    margin-right: 15px;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.navigation {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.navigation a {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.navigation a:hover {
    background: #34495e;
}

.current-page {
    background: #34495e !important;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    color: #27ae60;
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.2em;
}

.org-chart {
    width: 100%;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.level-1, .level-2, .level-3 {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
    position: relative;
}

.level-1::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 30px;
    background: #cbd5e0;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.level-2 {
    justify-content: space-around;
    padding-top: 30px;
    position: relative;
}

.level-2::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 2px;
    background: #cbd5e0;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.level-2::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 2px;
    background: #cbd5e0;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.level-3 {
    flex-wrap: wrap;
}

.staff-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.staff-group::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 100%;
    background: #cbd5e0;
    left: 50%;
    transform: translateX(-50%);
}

.section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background: #cbd5e0;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.subsection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 10px;
    position: relative;
    /* Hide subsections by default */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subsection.active {
    display: flex;
    opacity: 1;
}

.subsection::before {
    content: '';
    position: absolute;
    width: 2px;
    height: calc(100% - 20px);
    background: #cbd5e0;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subsection.active::before {
    opacity: 1;
}

.section-chief {
    position: relative;
    padding-right: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-chief::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.section-chief.expanded::after {
    transform: translateY(-50%) rotate(180deg);
}

.section-chief:hover {
    background-color: #f0f4f8;
    transform: translateY(-2px);
}

.box {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #e1e8ed;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    margin-left: 0;
}

.box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: #f7f9fc;
    border-color: #3498db;
    z-index: 2;
}

.box[contenteditable="true"] {
    border: 2px solid #3498db;
    background: #f7f9fc;
    z-index: 3;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #eee;
    color: #666;
}

.footer span {
    font-weight: bold;
}

@media (max-width: 1200px) {
    .level-3 {
        flex-direction: column;
        align-items: center;
    }

    .section {
        width: 100%;
        max-width: 600px;
    }

    .level-2::after,
    .level-2::before {
        width: 90%;
    }
}
