/* Department Detail CSS */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--border-radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    color: var(--text-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--secondary-light);
}

.page-header h1 {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h1 i {
    color: var(--secondary);
}

.dept-info {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.dept-info-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.dept-image {
    flex: 0 0 280px;
    width: 280px;
    max-width: 100%;
}

.dept-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.dept-text {
    flex: 1;
    min-width: 0; /* Prevent flex items from overflowing */
}

.dept-placeholder {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius-lg);
    font-size: 5rem;
    color: var(--text-light);
    margin: 0;
}

/* Vision, Mission, Goal Cards */
.vmg-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vmg-card {
    padding: 25px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.08);
}

.vmg-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    border-radius: 0 15px 15px 0;
}

[dir="ltr"] .vmg-card::before {
    right: auto;
    left: 0;
    border-radius: 15px 0 0 15px;
}

.vmg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.vmg-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.vmg-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.vmg-card p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
}

/* Vision Card - Blue */
.vmg-vision {
    background: linear-gradient(135deg, #e3f2fd, #f5f9ff);
}
.vmg-vision::before { background: #1565c0; }
.vmg-vision .vmg-icon { background: #1565c0; color: #fff; }
.vmg-vision h3 { color: #1565c0; }

/* Mission Card - Green */
.vmg-mission {
    background: linear-gradient(135deg, #e8f5e9, #f5fff6);
}
.vmg-mission::before { background: #2e7d32; }
.vmg-mission .vmg-icon { background: #2e7d32; color: #fff; }
.vmg-mission h3 { color: #2e7d32; }

/* Goal Card - Orange */
.vmg-goal {
    background: linear-gradient(135deg, #fff3e0, #fffff5);
}
.vmg-goal::before { background: #e65100; }
.vmg-goal .vmg-icon { background: #e65100; color: #fff; }
.vmg-goal h3 { color: #e65100; }

.dept-text h2 {
    color: var(--primary);
    margin-bottom: 20px;
    margin-top: 0;
    font-size: 1.8rem;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary-light);
    display: inline-block;
}

.dept-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: justify;
}

.dept-head {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.dept-head h4 {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.head-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.head-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: var(--shadow-sm);
}

.head-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: var(--text-light);
    border: 3px solid #fff;
    box-shadow: var(--shadow-sm);
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.branch-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.branch-card:hover {
    background: var(--primary);
    color: var(--text-light);
    transform: translateX(-5px);
}

.branch-card i {
    color: var(--secondary);
}

.staff-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 992px) {
    .staff-grid {
         grid-template-columns: repeat(2, 1fr);
    }
}

.staff-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: start;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1); /* Darker border */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Stronger shadow */
    transition: all 0.3s ease;
    height: auto;
    overflow: visible;
}

.staff-card::before {
    content: '';
    position: absolute;
    top: 15%;
    right: 0; 
    bottom: 15%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 4px 0 0 4px;
    opacity: 0.7;
}

[dir="ltr"] .staff-card::before {
    right: auto;
    left: 0;
    border-radius: 0 4px 4px 0;
}

.staff-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.staff-card:hover::before {
    opacity: 1;
    top: 10%;
    bottom: 10%;
}

.staff-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--secondary);
    padding: 2px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.staff-card:hover .staff-image {
    transform: scale(1.05);
}

.staff-image img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    font-size: 2rem;
    color: var(--text-light);
}

.staff-info {
    flex-grow: 1;
}

.staff-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.staff-title {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--secondary-dark);
    font-weight: 600;
    margin-bottom: 10px;
}

.staff-contact {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-item:hover {
    color: var(--primary);
}

.contact-item i {
    color: var(--primary);
    font-size: 1rem;
    transition: color 0.2s ease;
}

/* =========================================
   Responsive - Department Detail
   ========================================= */

@media (max-width: 768px) {
    .page-header {
        padding: 25px 20px;
        margin-bottom: 25px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .dept-info {
        padding: 25px 20px;
        margin-bottom: 25px;
    }

    .dept-info-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dept-image {
        width: 100%;
        max-width: 400px;
        flex: auto;
    }

    .dept-placeholder {
        height: 200px;
        font-size: 3.5rem;
    }

    .dept-text h2 {
        font-size: 1.4rem;
    }

    .vmg-card {
        padding: 20px;
    }

    .vmg-card h3 {
        font-size: 1.1rem;
    }

    .head-info {
        justify-content: center;
    }

    .branches-grid {
        grid-template-columns: 1fr;
    }

    .staff-card {
        padding: 15px;
        gap: 15px;
    }

    .staff-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 20px 15px;
    }

    .page-header h1 {
        font-size: 1.2rem;
    }

    .dept-info {
        padding: 15px;
    }

    .dept-placeholder {
        height: 180px;
        font-size: 3rem;
    }

    .dept-text h2 {
        font-size: 1.2rem;
    }

    .dept-text p {
        font-size: 0.95rem;
    }

    .vmg-card {
        padding: 15px;
    }

    .vmg-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .vmg-card h3 {
        font-size: 1rem;
    }

    .vmg-card p {
        font-size: 0.9rem;
    }

    .staff-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .staff-card::before {
        width: 100%;
        height: 4px;
        top: 0;
        right: 0;
        left: 0;
        bottom: auto;
        border-radius: 4px 4px 0 0;
    }

    [dir="ltr"] .staff-card::before {
        width: 100%;
        height: 4px;
    }

    .staff-image {
        width: 75px;
        height: 75px;
        margin: 0 auto 10px;
    }

    .staff-contact {
        justify-content: center;
    }

    .branch-card {
        padding: 12px 15px;
    }

    .head-info img,
    .head-placeholder {
        width: 50px;
        height: 50px;
    }
}