/* Modules Section Enhanced Styles */
.modules-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    overflow: hidden;
}

.modules-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="2" fill="%235850ec" opacity="0.1"/><circle cx="800" cy="300" r="2" fill="%237b5eff" opacity="0.1"/><circle cx="400" cy="600" r="2" fill="%235850ec" opacity="0.1"/><circle cx="700" cy="800" r="2" fill="%237b5eff" opacity="0.1"/></svg>');
    pointer-events: none;
}

/* Enhanced Section Title */
.modules-title {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
}

.modules-title h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    line-height: 1.2;
}

.modules-title p {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Enhanced Tabs Container */
.module-tabs-container {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 60px;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.module-tabs-container::-webkit-scrollbar {
    display: none;
}

/* Enhanced Tab Styling */
.module-tab {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-weight: 600;
    color: #64748b;
    position: relative;
    min-width: max-content;
    background: transparent;
}

.module-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #5850ec, #7b5eff);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.module-tab.active::before,
.module-tab:hover::before {
    opacity: 1;
}

.module-tab > * {
    position: relative;
    z-index: 1;
}

.module-tab.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 80, 236, 0.3);
}

.module-tab:hover:not(.active) {
    color: white;
    transform: translateY(-1px);
}

.module-tab i {
    font-size: 1.1rem;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.module-tab.active i {
    transform: scale(1.1);
}

/* Enhanced Module Content */
.modules-content-container {
    position: relative;
    min-height: 600px;
}

.module-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.module-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5850ec, #7b5eff, #5850ec);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.module-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Module Grid Layout */
.module-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .module-image-container {
        order: -1;
    }
}

/* Enhanced Module Details */
.module-details h3 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
    line-height: 1.2;
}

.module-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s ease;
    position: relative;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item:hover {
    transform: translateX(8px);
    background: rgba(88, 80, 236, 0.02);
    border-radius: 12px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0 -16px;
}

.feature-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5850ec, #7b5eff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.feature-icon i {
    color: white;
    font-size: 12px;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(88, 80, 236, 0.3);
}

.feature-text {
    font-size: 1.1rem;
    color: #334155;
    line-height: 1.6;
    font-weight: 500;
}

/* Enhanced Module Image */
.module-image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: all 0.5s ease;
}

.module-image-container:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

.module-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(88, 80, 236, 0.1), rgba(123, 94, 255, 0.1));
    z-index: 1;
    transition: opacity 0.3s ease;
}

.module-image-container:hover::before {
    opacity: 0;
}

.module-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.module-image-container:hover .module-image {
    transform: scale(1.05);
}

/* Stats Cards for Modules */
.module-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.stat-card {
    text-align: center;
    padding: 20px 16px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.stat-card:hover {
    background: rgba(88, 80, 236, 0.05);
    border-color: rgba(88, 80, 236, 0.2);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #5850ec, #7b5eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Module Navigation Dots */
.module-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot.active {
    background: linear-gradient(135deg, #5850ec, #7b5eff);
    transform: scale(1.2);
}

.nav-dot:hover:not(.active) {
    background: rgba(88, 80, 236, 0.5);
    transform: scale(1.1);
}

/* Floating Action Elements */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(88, 80, 236, 0.1), rgba(123, 94, 255, 0.1));
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: -2s;
}

.floating-shape:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 20%;
    right: 10%;
    animation-delay: -4s;
}

.floating-shape:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 5%;
    animation-delay: -1s;
}

.floating-shape:nth-child(4) {
    width: 70px;
    height: 70px;
    bottom: 30%;
    right: 5%;
    animation-delay: -3s;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Progressive Loading Animation */
.module-content.loading {
    opacity: 0;
    transform: translateY(30px);
}

.module-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .modules-section {
        padding: 80px 0;
    }
    
    .module-content {
        padding: 32px;
    }
    
    .module-details h3 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .modules-section {
        padding: 60px 0;
    }
    
    .module-tabs-container {
        padding: 6px;
        margin-bottom: 40px;
    }
    
    .module-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .module-content {
        padding: 24px;
        border-radius: 16px;
    }
    
    .module-details h3 {
        font-size: 1.75rem;
        margin-bottom: 24px;
    }
    
    .feature-text {
        font-size: 1rem;
    }
    
    .module-image {
        height: 300px;
    }
    
    .module-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 24px;
        padding-top: 24px;
    }
}

/* Additional responsive design classes for testing */
.responsive-section {
    width: 100%;
    padding: 1rem;
}

.responsive-content {
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .responsive-section {
        padding: 0.5rem;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
    
    .show-desktop {
        display: block;
    }
}

/* Mobile responsive utilities */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

.desktop-only {
    display: block;
}

/* End responsive additions */

@media (max-width: 480px) {
    .modules-title h2 {
        font-size: 2rem;
    }
    
    .modules-title p {
        font-size: 1rem;
    }
    
    .module-tab span {
        display: none;
    }
    
    .module-tab {
        padding: 12px;
    }
    
    .module-content {
        padding: 20px;
    }
    
    .module-details h3 {
        font-size: 1.5rem;
    }
}

/* High Performance Mode */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shape {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modules-section {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .modules-title h2 {
        background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .modules-title p {
        color: #94a3b8;
    }
    
    .module-content {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(51, 65, 85, 0.3);
    }
    
    .feature-text {
        color: #cbd5e1;
    }
    
    .stat-card {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(51, 65, 85, 0.3);
    }
}

/* Print Styles */
@media print {
    .modules-section {
        background: white !important;
        color: black !important;
    }
    
    .module-tab:not(.active) {
        display: none;
    }
    
    .module-content:not(.active) {
        display: block !important;
        opacity: 1 !important;
        page-break-after: always;
    }
    
    .floating-elements {
        display: none;
    }
}
