/* Custom Modules Section Styles */
.custom-modules-section {
    background: #FFFFFF;
    padding: 80px 0 80px 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

@media (max-width: 639px) {
    .custom-modules-section {
        overflow-x: hidden;
        overflow-y: visible;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .custom-modules-section {
        overflow-x: hidden;
        overflow-y: hidden;
    }
}

@media (min-width: 1024px) {
    .custom-modules-section {
        padding: 80px 0 80px 0;
        overflow: hidden;
    }
}

/* Animated SVG backgrounds */
.custom-modules-svg-desktop {
    display: none;
    position: absolute;
    top: 40px;
    left: 63%;
    transform: translateX(-52%);
    width: 125%;
    max-width: 2400px;
    height: auto;
    z-index: 1;
}

@media (min-width: 640px) {
    .custom-modules-svg-desktop {
        display: block;
    }
}

@media (min-width: 768px) {
    .custom-modules-svg-desktop {
        top: 120px;
        left: 65%;
        transform: translateX(-53%);
        width: 130%;
    }
}

@media (min-width: 1024px) {
    .custom-modules-svg-desktop {
        top: 60px;
        left: 66%;
        transform: translateX(-54%);
        width: 140%;
    }
}

@media (min-width: 1280px) {
    .custom-modules-svg-desktop {
        top: 70px;
        left: 74%;
        transform: translateX(-55%);
        width: 150%;
    }
}

@media (min-width: 1536px) {
    .custom-modules-svg-desktop {
        top: 80px;
        left: 70%;
        transform: translateX(-56%);
        width: 160%;
    }
}

.custom-modules-svg-mobile {
    display: block;
    position: absolute;
    top: 20px;
    left: 48%;
    transform: translateX(-52%);
    width: 140%;
    max-width: 600px;
    height: auto;
    z-index: 1;
}

@media (max-width: 480px) {
    .custom-modules-svg-mobile {
        top: 10px;
        left: 47%;
        width: 120%;
        transform: translateX(-53%) scale(0.9);
    }
}

@media (min-width: 640px) {
    .custom-modules-svg-mobile {
        display: none;
    }
}

/* Container */
.custom-modules-section .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 1280px) {
    .custom-modules-section .container {
        padding: 0 16px;
    }
}

/* Header */
.custom-modules-header {
    margin-bottom: 32px;
    text-align: center;
}

@media (min-width: 1024px) {
    .custom-modules-header {
        margin-bottom: 60px;
    }
}

.custom-modules-title {
    font-family: 'Gilroy-semibold';
    font-weight: 500;
    color: #3F405B;
    font-size: 45px;
    line-height: 46.6px;
    margin-bottom: 10px;
    text-align: center;
}

@media (min-width: 1280px) {
    .custom-modules-title {
        font-size: 45px;
        line-height: 46.5px;
    }
}

.custom-modules-title .accent-dot {
    color: #FFAF30;
    text-shadow: 0 0 10px rgba(255, 175, 48, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 175, 48, 0.3);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 175, 48, 0.5);
    }
}

/* Custom Grid Layout */
.custom-modules-grid {
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .custom-modules-grid {
        margin-top: 60px;
    }
}

/* Masonry Layout for first 12 cards */
.modules-masonry-wrapper {
    columns: 1;
    column-gap: 22px;
    break-inside: avoid;
}

@media (min-width: 768px) {
    .modules-masonry-wrapper {
        columns: 2;
    }
}

@media (min-width: 1024px) {
    .modules-masonry-wrapper {
        columns: 3;
    }
}

/* Centered layout for last 2 cards */
.modules-centered-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
    margin-top: 22px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .modules-centered-wrapper {
        display: block;
        columns: 1;
        column-gap: 22px;
        margin-top: 0;
    }
}

@media (min-width: 768px) {
    .modules-centered-wrapper {
        flex-wrap: nowrap;
        max-width: 800px;
        margin: 22px auto 0;
    }
}

@media (min-width: 1024px) {
    .modules-centered-wrapper {
        max-width: 650px;
    }
}

.modules-centered-wrapper .custom-module-card {
    flex: 1;
    max-width: 100%;
}

@media (max-width: 767px) {
    .modules-centered-wrapper .custom-module-card {
        break-inside: avoid;
        margin-bottom: 20px;
        width: 100%;
    }
}

@media (min-width: 768px) {
    .modules-centered-wrapper .custom-module-card {
        max-width: 380px;
    }
}

@media (min-width: 1024px) {
    .modules-centered-wrapper .custom-module-card {
        max-width: 300px;
    }
}

/* Module Card */
.custom-module-card {
    width: 100%;
    padding: 40px;
    background: #ffffff;
    text-align: center;
    break-inside: avoid;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid #E7E5FF;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 175, 48, 0.3);
}

/* Module Icon */
.custom-module-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
}

.custom-module-icon svg {
    width: 56px;
    height: 56px;
}

.custom-module-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* Module Content */
.custom-module-content {
    max-width: 300px;
    margin: 0 auto;
}

.custom-module-title {
    font-family: 'Gilroy-Semibold', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #3F405B;
    font-size: 20px;
    line-height: 28.8px;
    font-weight: 600;
    margin-bottom: 18px;
}

@media (min-width: 1280px) {
    .custom-module-title {
        font-size: 24px;
    }
}

.custom-module-description {
    font-family: 'Gilroy-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #6c757d;
    font-weight: 400;
    font-size: 15px;
    line-height: 22.5px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 767px) {
    .custom-modules-section {
        padding: 60px 0 60px 0;
    }

    .custom-modules-header {
        margin-bottom: 32px;
        padding: 0 20px;
    }

    .custom-modules-title {
        font-size: 28px;
        line-height: 34px;
    }

    .custom-module-card {
        padding: 30px 20px;
    }

    .custom-module-title {
        font-size: 18px;
        line-height: 24px;
    }

    .custom-module-description {
        font-size: 14px;
        line-height: 21px;
    }
}

@media (max-width: 480px) {
    .custom-modules-masonry {
        column-gap: 16px;
    }
    
    .custom-module-card {
        padding: 24px 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 430px) {
    .custom-modules-section {
        padding: 40px 5px;
    }
    .custom-modules-title {
        font-size: 25px;
        line-height: 34px;
    }
    .custom-module-description {
        font-size: 14px;
        line-height: 21px;
        font-family: 'Gilroy-Light';
    }
}
@media (min-width: 320px) and (max-width: 429px) {
    .custom-modules-title {
        font-size: 30px;
        line-height: 30px;
        margin: 0 -35px;
    }
}

/* Dark Theme Support */
body.dark .custom-modules-section {
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
}

body.dark .custom-modules-title {
    color: #f9fafb;
}

body.dark .custom-module-card {
    background: linear-gradient(145deg, #374151 0%, #4b5563 100%);
    border-color: #6b7280;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark .custom-module-card:hover {
    background: linear-gradient(145deg, #4b5563 0%, #6b7280 100%);
    border-color: rgba(255, 175, 48, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark .custom-module-title {
    color: #f9fafb;
}

body.dark .custom-module-description {
    color: #d1d5db;
}

/* Animation for cards */
.custom-module-card {
    animation: fadeInUp 0.6s ease-out;
}

.custom-module-card:nth-child(1) { animation-delay: 0.1s; }
.custom-module-card:nth-child(2) { animation-delay: 0.2s; }
.custom-module-card:nth-child(3) { animation-delay: 0.3s; }
.custom-module-card:nth-child(4) { animation-delay: 0.4s; }
.custom-module-card:nth-child(5) { animation-delay: 0.5s; }
.custom-module-card:nth-child(6) { animation-delay: 0.6s; }
.custom-module-card:nth-child(7) { animation-delay: 0.7s; }
.custom-module-card:nth-child(8) { animation-delay: 0.8s; }
.custom-module-card:nth-child(9) { animation-delay: 0.9s; }
.custom-module-card:nth-child(10) { animation-delay: 1.0s; }
.custom-module-card:nth-child(11) { animation-delay: 1.1s; }
.custom-module-card:nth-child(12) { animation-delay: 1.2s; }
.custom-module-card:nth-child(13) { animation-delay: 1.3s; }
.custom-module-card:nth-child(14) { animation-delay: 1.4s; }
.custom-module-card:nth-child(15) { animation-delay: 1.5s; }
.custom-module-card:nth-child(16) { animation-delay: 1.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for SVG path */
.paymoney_animatedPath__H3f__ {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    animation: drawPath 4s ease-in-out forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}