.departments-section {
    background-color: #f8faff;
    padding: 80px 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Section Background Elements */
.departments-section::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 250px;
    height: 250px;
    background-image: radial-gradient(#2143d2 2.5px, transparent 2.5px);
    background-size: 25px 25px;
    opacity: 0.1;
    z-index: -1;
}

.departments-section::after {
    content: '';
    position: absolute;
    bottom: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(33, 67, 210, 0.08) 0%, transparent 65%);
    z-index: -1;
}

.departments-bg-pattern {
    position: absolute;
    top: 15%;
    right: 8%;
    width: 120px;
    height: 120px;
    border: 2px dashed rgba(33, 67, 210, 0.15);
    border-radius: 50%;
    z-index: -1;
    animation: rotateText 20s linear infinite;
}

.departments-bg-pattern::after {
    content: '';
    position: absolute;
    bottom: -60vh;
    left: -85vw;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(33, 67, 210, 0.1), transparent);
    border-radius: 16px;
    transform: rotate(45deg);
    z-index: -1;
}

@keyframes rotateText {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.departments-section .section-title {
    margin-bottom: 50px;
}

.dept-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px 20px;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.dept-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

/* Faint soft shape in the background left */
.dept-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 150px;
    height: 150px;
    background: var(--theme-bg);
    filter: blur(40px);
    transform: translateY(-50%);
    z-index: 0;
    opacity: 0.6;
}

/* Dots in the bottom left */
.dept-card::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 32px;
    height: 32px;
    background-image: radial-gradient(rgba(0, 0, 0, 0.12) 2px, transparent 2px);
    background-size: 8px 8px;
    z-index: 0;
}

.dept-icon-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 15px;
    position: relative;
    background: var(--theme-bg);
    z-index: 1;
}

/* Small floating shapes around the icon to match reference */
.dept-icon-wrapper::before,
.dept-icon-wrapper::after,
.dept-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.dept-icon-wrapper::before {
    content: '';
    background: var(--theme-color);
    border-radius: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    margin-left: -4px;
    opacity: 0.5;
    transform: rotate(0deg) translate(45px, -35px);
}

.dept-icon-wrapper::after {
    content: '';
    background: var(--theme-color);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    margin-left: -7px;
    opacity: 0.8;
    transform: rotate(0deg) translate(55px, -5px);
}

/* Subtle cross icon element */
.dept-cross {
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    color: var(--theme-color);
    opacity: 0.7;
    transform: rotate(0deg) translate(35px, -50px);
}

.dept-cross::before,
.dept-cross::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
}

.dept-cross::before {
    width: 100%;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.dept-cross::after {
    height: 100%;
    width: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* Hover orbital rotation effects - changed to auto-rotation */
.dept-icon-wrapper::before {
    animation: orbitBefore 10s linear infinite;
}

.dept-icon-wrapper::after {
    animation: orbitAfter 15s linear infinite;
}

.dept-cross {
    animation: orbitCross 12s linear infinite;
}

@keyframes orbitBefore {
    0% { transform: rotate(0deg) translate(45px, -35px) rotate(0deg); }
    100% { transform: rotate(360deg) translate(45px, -35px) rotate(-360deg); }
}

@keyframes orbitAfter {
    0% { transform: rotate(120deg) translate(55px, -5px) rotate(-120deg); }
    100% { transform: rotate(480deg) translate(55px, -5px) rotate(-480deg); }
}

@keyframes orbitCross {
    0% { transform: rotate(240deg) translate(35px, -50px) rotate(-240deg); }
    100% { transform: rotate(600deg) translate(35px, -50px) rotate(-600deg); }
}

/* Additional Background Shapes for the Section */
.departments-bg-pattern-2 {
    position: absolute;
    top: 60%;
    left: -40px;
    width: 80px;
    height: 80px;
    background: radial-gradient(#2143d2 2.5px, transparent 2.5px);
    background-size: 20px 20px;
    opacity: 0.15;
    z-index: -1;
    animation: floatVertical 6s ease-in-out infinite;
}

.departments-bg-shape {
    position: absolute;
    top: 5%;
    left: 20%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(230, 105, 0, 0.15); /* orange theme color hint */
    border-radius: 10px;
    transform: rotate(20deg);
    z-index: -1;
    animation: floatRotate 8s linear infinite;
}

@keyframes floatVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes floatRotate {
    0% { transform: translateY(0) rotate(20deg); }
    50% { transform: translateY(-15px) rotate(45deg); }
    100% { transform: translateY(0) rotate(20deg); }
}

.dept-icon-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border-radius: 50%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.dept-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.dept-content h3 {
    font-size: 19px;
    font-weight: 800;
    color: #111;
    margin-bottom: 6px;
    line-height: 1.25;
}

.dept-title-line {
    width: 35px;
    height: 3px;
    border-radius: 3px;
    background-color: var(--theme-color);
    margin-bottom: 12px;
}

.dept-content p {
    font-size: 13px;
    color: #555;
    margin-bottom: 18px;
    line-height: 1.5;
}

.btn-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1.5px solid var(--theme-color);
    background: transparent;
    width: max-content;
    color: var(--theme-color);
}

.btn-explore:hover {
    background: var(--theme-color);
    color: #fff !important;
}

/* Color Themes */
.aero-theme {
    --theme-color: #005ce6;
    --theme-bg: rgba(0, 92, 230, 0.12);
}

.ai-theme {
    --theme-color: #791cff;
    --theme-bg: rgba(121, 28, 255, 0.12);
}

.cse-theme {
    --theme-color: #00a36e;
    --theme-bg: rgba(0, 163, 110, 0.12);
}

.mech-theme {
    --theme-color: #e66900;
    --theme-bg: rgba(230, 105, 0, 0.12);
}

.ece-theme {
    --theme-color: #008cff;
    --theme-bg: rgba(0, 140, 255, 0.12);
}

.it-theme {
    --theme-color: #dc0055;
    --theme-bg: rgba(220, 0, 85, 0.12);
}

.pharma-theme {
    --theme-color: #2841e6;
    --theme-bg: rgba(40, 65, 230, 0.12);
}

.mba-theme {
    --theme-color: #0f62fe;
    --theme-bg: rgba(15, 98, 254, 0.12);
}

.sh-theme {
    --theme-color: #e67e22;
    --theme-bg: rgba(230, 126, 34, 0.12);
}

@media (max-width: 1199px) and (min-width: 992px) {
    .dept-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px;
    }
}

@media (max-width: 767px) {
    .dept-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px;
    }

    .dept-card::after {
        left: 250px;
    }
}