/* Module Switcher Styles */
.module-switcher {
    position: relative;
    display: inline-block;
}

.module-grid-icon {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.module-grid-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.module-grid-icon .dot {
    width: 3px;
    height: 3px;
    background-color: white;
    border-radius: 50%;
}

.module-grid-icon .dot-row {
    display: flex;
    gap: 2px;
}

.module-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    width: 280px;
    margin-top: 8px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.module-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.module-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.module-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.module-item:hover {
    background-color: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #374151;
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}

.module-icon.tradesphere {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    position: relative;
    overflow: hidden;
}

.module-icon.tradesphere::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    border-radius: 8px;
    pointer-events: none;
}

.module-icon.tradesphere i {
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.module-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.module-icon.tradesphere svg {
    width: 26px;
    height: 26px;
}

.module-name {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    margin: 0;
}

.module-dropdown-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.module-dropdown-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.module-dropdown-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* Overlay for mobile */
.module-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.module-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .module-dropdown {
        width: 300px;
        right: -50px;
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .module-item {
        padding: 16px 12px;
    }
    
    .module-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .module-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .module-icon.tradesphere svg {
        width: 30px;
        height: 30px;
    }
    
    .module-name {
        font-size: 13px;
    }
}