/* Core Modules Section */
.core-modules-section {
    padding: 80px 0;
    background: #f8f9fa;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
    position: relative;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #008c98);
    margin: 15px auto 0;
    transition: width 0.4s ease;
}

.section-title .core-text {
    color: #001f3f; /* Navy blue */
    font-weight: 700;
}

.section-title .highlight {
    color: #008c98;
    font-weight: 700;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    position: relative;
}

.module-card {
    background: white;
    border-radius: 0;
    padding: 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    opacity: 1;
    transition: 
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s ease,
        box-shadow 0.4s ease;
}

.card-top-content {
    padding: 30px 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    background: white;
}

.module-icon {
    width: 48px;
    height: 48px;
    filter: brightness(0) saturate(100%) invert(35%) sepia(48%) saturate(1518%) hue-rotate(145deg) brightness(89%) contrast(101%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.2rem;
    color: #008c98;
    font-weight: 600;
    transition: all 0.4s ease;
    font-family: 'Inter', sans-serif;
    margin-bottom: 10px;
}

.card-description {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: 
        max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s ease 0.1s,
        padding 0.4s ease;
    color: white;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0 2px;
    text-align: left;
    font-family: 'Manrope', sans-serif;
}

.card-description ul {
    padding-left: 20px;
    margin: 0;
}

.card-description li {
    padding: 4px 0;
    list-style-type: disc;
    font-size: 0.9rem;
}

/* Hover Effects */
.module-card:hover {
    transform: scale(1.05) translateZ(10px);
    box-shadow: 0 15px 30px rgba(0, 140, 152, 0.15);
    z-index: 2;
    background: #008c98;
}

.module-card:hover .card-top-content {
    background: #008c98;
    padding-top: 25px;
    padding-bottom: 15px;
}

.module-card:hover .module-icon {
    filter: brightness(0) invert(1);
    transform: scale(1.12);
}

.module-card:hover .card-title {
    color: white;
    transform: translateY(-5px);
}

.module-card:hover .card-description {
    max-height: 200px;
    opacity: 1;
    padding: 15px 20px;
}

/* Modal Styles with Animsition Fixes */
body.modal-open {
    overflow: hidden;
}

body.modal-open .animsition,
body.modal-open .wrapper {
    overflow: visible;
    height: auto;
}

.module-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s ease-out;
}

.module-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.module-modal {
    width: 80%;
    max-width: 900px;
    background: #008c98;
    padding: 40px;
    position: relative;
    transform: translateY(100px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    color: white;
    border-radius: 0;
    opacity: 0;
    transform-origin: bottom center;
}

.module-modal-overlay.active .module-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.module-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
}

.module-modal-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.module-modal-title {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    margin-bottom: 15px;
    color: white;
}

.module-modal-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 80%;
    color: white;
}

.module-modal-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
}

.module-modal-features {
    columns: 2;
    column-gap: 40px;
    margin-bottom: 30px;
    width: 100%;
}

.module-modal-features ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.module-modal-features li {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 12px;
    position: relative;
    padding-left: 25px;
    color: white;
}

.module-modal-features li:before {
    content: "•";
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -3px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-modal:hover {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 1199px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .module-modal {
        aspect-ratio: auto;
        height: auto;
        max-height: 80vh;
        overflow-y: auto;
    }
    .module-modal-features {
        columns: 1;
    }
}

@media (max-width: 767px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .section-title::after {
        width: 60px;
    }
    .module-modal {
        width: 90%;
        padding: 30px 20px;
    }
    .module-modal-title {
        font-size: 1.6rem;
    }
    .module-modal-subtitle {
        font-size: 1rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .card-description {
        font-size: 0.85rem;
        padding: 0 15px;
    }
    .card-title {
        font-size: 1.1rem;
    }
}