html {
    scroll-behavior: smooth;
}

.column-container {
    display: flex;
    flex-direction: column;
    width: calc((100% - 3rem) / 3);
    flex-shrink: 0;
    gap: 0;
}

.card-container {
    height: fit-content;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(11, 102, 158, 0.12),
                0 0 0 1px rgba(11, 102, 158, 0.08);
    border-radius: 1rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.card-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(53, 184, 224, 0.1), transparent);
    transition: left 0.6s ease;
}

.card-container:hover::before {
    left: 100%;
}

.card-container:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 35px rgba(11, 102, 158, 0.2),
                0 0 0 1px rgba(11, 102, 158, 0.15);
    border-color: rgba(53, 184, 224, 0.3);
}

.card-container.active {
    box-shadow: 0 8px 32px rgba(11, 102, 158, 0.25),
                0 0 0 2px rgba(53, 184, 224, 0.3);
    transform: scale(1.01);
    overflow: visible;
}

.card-container.active::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #62BB46, #51A45C);
    border-radius: 0 1rem 1rem 0;
    animation: activeIndicator 2s ease infinite;
}

@keyframes activeIndicator {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.icon-container {
    position: relative;
    margin-top: 2rem;
    width: 7rem;
    height: 7rem;
    transition: transform 0.3s ease;
}

.card-container:hover .icon-container {
    transform: scale(1.1) rotateY(10deg);
}

.card-container.active .icon-container {
    transform: scale(1.05);
}

.card-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.card-container:hover .card-shape {
    transform: rotate(15deg) scale(1.05);
    opacity: 0.9;
}

.card-container.active .card-shape {
    transform: rotate(10deg) scale(1.02);
}

.card-icon {
    position: absolute;
    width: 4.1875rem;
    height: 4.1875rem;
    z-index: 99;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(11, 102, 158, 0.15));
}

.card-container:hover .card-icon {
    transform: translate(-50%, -50%) scale(1.15);
    filter: drop-shadow(0 6px 12px rgba(11, 102, 158, 0.25));
}

.card-title {
    font-size: 1.125rem;
    color: #233b77;
    font-weight: bold;
    margin-top: 1rem;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(35, 59, 119, 0.1);
}

.card-container:hover .card-title {
    color: #0B669E;
    transform: scale(1.05);
}

.card-container.active .card-title {
    color: #0B669E;
    transform: scale(1.03);
}

.card-description {
    color: #6f6f6f;
    font-weight: 500;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 2.25rem;
    text-align: center;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.card-container:hover .card-description {
    color: #5a5a5a;
}

.card-content {
    display: grid;
    gap: 1.25rem;
    height: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, padding 0.4s ease;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
    align-items: start;
    margin-bottom: 1.5rem;
    opacity: 0;
    padding: 0;
}

.card-container.active .card-content {
    max-height: 500rem;
    opacity: 1;
    padding: 1rem 0;
    overflow: visible;
}

.card-content:has(> .department-button:only-child) {
    grid-template-columns: 1fr;
}

.card-container.active .card-content:has(> .department-button:only-child) {
    padding: 1rem 25%;
}

.department-button {
    width: 100%;
    min-height: 2.75rem;
    display: flex;
    background: linear-gradient(135deg, #0b669e, #0B5A8A);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(11, 102, 158, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    grid-column: auto;
    align-self: stretch;
    height: 3.5rem;
}

.department-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.department-button:hover::before {
    width: 300px;
    height: 300px;
}

.department-button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 18px rgba(11, 102, 158, 0.4);
    background: linear-gradient(135deg, #35B8E0, #0b669e);
}

.department-button:active {
    transform: translateY(-1px) scale(1.01);
}

.department-button p {
    color: #ffffff;
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
    line-height: 1.4;
    margin: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.department-button:hover p {
    transform: translateX(-2px);
}

.department-button img {
    width: 1rem;
    height: 1rem;
    margin: auto 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    filter: brightness(0) invert(1);
}

.department-button:hover img {
    transform: translateX(3px);
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(3px); }
    50% { transform: translateX(6px); }
}

@media (max-width: 768px) {
    .cards-container {
        display: flex;
        flex-direction: column;
    }

    .column-container {
        width: 100%;
    }

    .card-container {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }

    .card-container:hover {
        transform: translateY(-3px) scale(1.01);
    }

    .card-container:hover::before {
        left: 100%;
    }

    .card-container:hover .icon-container {
        transform: scale(1.08) rotateY(8deg);
    }

    .card-container:hover .card-shape {
        transform: rotate(12deg) scale(1.03);
        opacity: 0.9;
    }

    .card-container:hover .card-icon {
        transform: translate(-50%, -50%) scale(1.12);
        filter: drop-shadow(0 6px 12px rgba(11, 102, 158, 0.25));
    }

    .icon-container {
        width: 6rem;
        height: 6rem;
        margin-top: 1.5rem;
    }

    .card-icon {
        width: 3.5rem;
        height: 3.5rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-description {
        font-size: 0.8125rem;
        margin-bottom: 1.5rem;
    }

    .card-content {
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .card-container.active .card-content {
        padding: 1rem 0;
    }

    .card-content:has(> .department-button:only-child) {
        grid-template-columns: 1fr;
    }

    .card-container.active .card-content:has(> .department-button:only-child) {
        padding: 1rem 10%;
    }

    .department-button {
        min-height: 2.5rem;
        height: 3.25rem;
        padding: 0.65rem 0.875rem;
    }

    .department-button::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.5s, height 0.5s;
    }

    .department-button:hover::before {
        width: 250px;
        height: 250px;
    }

    .department-button:hover img {
        transform: translateX(3px);
        animation: arrowBounce 0.6s ease infinite;
    }

    .department-button p {
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .card-container {
        padding: 0 0.75rem;
    }

    .card-container:hover {
        transform: translateY(-2px) scale(1.005);
    }

    .card-container:hover .icon-container {
        transform: scale(1.05) rotateY(5deg);
    }

    .card-container:hover .card-shape {
        transform: rotate(8deg) scale(1.02);
    }

    .card-container:hover .card-icon {
        transform: translate(-50%, -50%) scale(1.08);
    }

    .icon-container {
        width: 5rem;
        height: 5rem;
        margin-top: 1.25rem;
    }

    .card-icon {
        width: 3rem;
        height: 3rem;
    }

    .card-title {
        font-size: 0.9375rem;
    }

    .card-description {
        font-size: 0.75rem;
        margin-top: 0.375rem;
        margin-bottom: 1.25rem;
    }

    .card-content {
        gap: 0.875rem;
    }

    .card-container.active .card-content {
        padding: 0.875rem 0;
    }

    .department-button {
        min-height: 2.5rem;
        height: 3rem;
        padding: 0.625rem 0.75rem;
    }

    .department-button:hover::before {
        width: 200px;
        height: 200px;
    }

    .department-button p {
        font-size: 0.875rem;
    }

    .department-button img {
        width: 0.875rem;
        height: 0.875rem;
    }
}
